cqrs-eventdenormalizer
Advanced tools
Comparing version 1.1.9 to 1.1.10
@@ -71,56 +71,8 @@ 'use strict'; | ||
replay: function (evts, callback) { | ||
var self = this; | ||
var revisionMap = {}; | ||
var eventViewBuilderMap = []; // [{ event: evt, viewBuilders: [] }] | ||
var collections = {}; | ||
_.each(evts, function (evt) { | ||
if (!!self.definition.revision && dotty.exists(evt, self.definition.revision) && | ||
!!self.definition.aggregateId && dotty.exists(evt, self.definition.aggregateId)) { | ||
var aggId = dotty.get(evt, self.definition.aggregateId); | ||
revisionMap[aggId] = dotty.get(evt, self.definition.revision); | ||
} | ||
var target = self.dispatcher.getTargetInformation(evt); | ||
var viewBuilders = self.dispatcher.tree.getViewBuilders(target); | ||
eventViewBuilderMap.push({ event: evt, viewBuilders: viewBuilders }); | ||
_.each(viewBuilders, function (vb) { | ||
if (!collections[vb.collection.workerId]) { | ||
vb.collection.isReplaying = true; | ||
collections[vb.collection.workerId] = vb.collection; | ||
} | ||
this.replayStreamed(function (replay, done) { | ||
evts.forEach(function (evt) { | ||
replay(evt); | ||
}); | ||
done(callback) | ||
}); | ||
async.series([ | ||
function (callback) { | ||
async.eachSeries(eventViewBuilderMap, function (item, callback) { | ||
async.each(item.viewBuilders, function (vb, callback) { | ||
vb.denormalize(item.event, callback); | ||
}, callback); | ||
}, callback); | ||
}, | ||
function (callback) { | ||
async.each(_.values(collections), function (col, callback) { | ||
col.saveReplayingVms(callback); | ||
}, callback); | ||
}, | ||
function (callback) { | ||
self.updateRevision(revisionMap, callback); | ||
} | ||
], function (err) { | ||
if (err) { | ||
debug(err); | ||
} | ||
if (callback) { | ||
callback(err); | ||
} | ||
}); | ||
}, | ||
@@ -127,0 +79,0 @@ |
{ | ||
"author": "adrai", | ||
"name": "cqrs-eventdenormalizer", | ||
"version": "1.1.9", | ||
"version": "1.1.10", | ||
"private": false, | ||
@@ -22,3 +22,3 @@ "main": "index.js", | ||
"tolerance": "1.0.0", | ||
"viewmodel": "1.2.3" | ||
"viewmodel": "1.2.4" | ||
}, | ||
@@ -25,0 +25,0 @@ "devDependencies": { |
@@ -0,1 +1,4 @@ | ||
## [v1.1.10](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.1.9...v1.1.10) | ||
- update viewmodel dependency | ||
## [v1.1.9](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.1.8...v1.1.9) | ||
@@ -2,0 +5,0 @@ - update viewmodel dependency |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
175347
3094
+ Addedviewmodel@1.2.4(transitive)
- Removedviewmodel@1.2.3(transitive)
Updatedviewmodel@1.2.4