Permalink
Browse files

added optional callback to defaultHandle of commandHandler

  • Loading branch information...
1 parent 6cb1bf9 commit 6551d4a297afc09dd2c510e2d50c3f4775e76ed5 @adrai committed Feb 7, 2014
Showing with 7 additions and 2 deletions.
  1. +4 −0 README.md
  2. +2 −1 lib/bases/commandHandlerBase.js
  3. +1 −1 package.json
View
@@ -125,6 +125,10 @@ See [tests](https://github.com/adrai/node-cqrs-domain/tree/master/test) for deta
# Release Notes
+## v0.7.8
+
+- added optional callback on commandhandler defaultHandle
+
## v0.7.7
- optimization for npm module naming
@@ -24,7 +24,7 @@ util.inherits(CommandHandler, EventEmitter2);
_.extend(CommandHandler.prototype, {
- defaultHandle: function(id, cmd) {
+ defaultHandle: function(id, cmd, callback) {
var self = this;
@@ -73,6 +73,7 @@ _.extend(CommandHandler.prototype, {
// finally publish commandRejected event on error
function(err) {
+ if (callback) callback(err);
self.finish(id, cmd, err);
});
},
View
@@ -1,7 +1,7 @@
{
"author": "adrai",
"name": "cqrs-domain",
- "version": "0.7.7",
+ "version": "0.7.8",
"private": false,
"main": "index.js",
"engines": {

0 comments on commit 6551d4a

Please sign in to comment.