Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It would be nice, if CQRS.sendCommand would return a promise #4

Closed
xeronimus opened this issue Sep 12, 2014 · 0 comments
Closed

It would be nice, if CQRS.sendCommand would return a promise #4

xeronimus opened this issue Sep 12, 2014 · 0 comments

Comments

@xeronimus
Copy link
Contributor

In some controllers, you want to send multiple commands simultaneously and do something if all of them "returned an event".

 var promiseOne = CQRS.sendCommand({
          command: 'move',
          payload: {attribute: 'one'}
        });

 var promiseTwo = CQRS.sendCommand({
          command: 'hop',
          payload: {attribute: 'two'}
        });

$q.all([promiseOne,promiseTwo]).then(function(){
// received matching events for both commands!
});
xeronimus added a commit that referenced this issue Sep 19, 2014
xeronimus added a commit that referenced this issue Sep 19, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant