Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Commit

Permalink
fixed saga handler base
Browse files Browse the repository at this point in the history
  • Loading branch information
Adriano Raiano committed Feb 25, 2013
1 parent 155761d commit 605def4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,16 @@ It can be very useful as domain and eventdenormalizer component if you work with

See [tests](https://github.com/adrai/node-cqs/tree/master/test) for detailed information...

# Release Notes

## v0.3.6

- fixed saga handler base


# License

Copyright (c) 2012 Adriano Raiano
Copyright (c) 2013 Adriano Raiano

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 4 additions & 3 deletions lib/domain/bases/sagaHandlerBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SagaHandler.prototype = {
var self = this;

function initSaga(id, data) {
var saga = new this.Saga(id);
var saga = new self.Saga(id);
saga.load(data);
self.sagas[id] = saga;
}
Expand All @@ -21,7 +21,7 @@ SagaHandler.prototype = {
if (!err) {
for(var i = 0, len = sagas.length; i < len; i++) {
var saga = sagas[i];
initSaga(stream.id, saga);
initSaga(saga.id, saga);
}
}
});
Expand All @@ -45,7 +45,7 @@ SagaHandler.prototype = {
callback(null, saga);
},

// commit
// commit the uncommittedEvents
function(saga, callback) {
self.commit(saga, callback);
}
Expand All @@ -62,6 +62,7 @@ SagaHandler.prototype = {
commit: function(saga, callback) {
var self = this;
this.repository.get(saga.id, function(err, vm) {
vm.set('type', self.saga);
if (saga.get('destroyed')) {
vm.destroy();
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "adrai",
"name": "node-cqs",
"version": "0.3.5",
"version": "0.3.6",
"private": false,
"main": "index.js",
"engines": {
Expand Down

0 comments on commit 605def4

Please sign in to comment.