Comparing version 0.24.0 to 0.24.1
@@ -75,3 +75,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
Context = __webpack_require__(12); | ||
Context = __webpack_require__(14); | ||
@@ -82,3 +82,3 @@ InmemoryStore = __webpack_require__(25); | ||
logger = __webpack_require__(23); | ||
logger = __webpack_require__(12); | ||
@@ -639,6 +639,8 @@ remoteContextHash = {}; | ||
var ProjectionService, uuidGenerator; | ||
var ProjectionService, logger, uuidGenerator; | ||
uuidGenerator = __webpack_require__(10); | ||
logger = __webpack_require__(12); | ||
ProjectionService = (function() { | ||
@@ -649,3 +651,2 @@ function ProjectionService(_context) { | ||
this._projectionInstances = {}; | ||
this._domainEventsApplied = {}; | ||
} | ||
@@ -678,3 +679,3 @@ | ||
eventNames = _eventNames; | ||
return _this._applyDomainEventsFromStoreToProjection(projectionId, projectionInstance, eventNames, aggregateId); | ||
return _this._applyDomainEventsFromStoreToProjection(projectionInstance, eventNames, aggregateId); | ||
}; | ||
@@ -697,3 +698,3 @@ })(this)).then((function(_this) { | ||
ProjectionService.prototype._callInitializeOnProjection = function(projection, params) { | ||
return new Promise(function(resolve, reject) { | ||
return new Promise(function(resolve) { | ||
if (!projection.initialize) { | ||
@@ -709,3 +710,3 @@ return resolve(projection); | ||
ProjectionService.prototype._parseEventNamesFromProjection = function(projection) { | ||
return new Promise(function(resolve, reject) { | ||
return new Promise(function(resolve) { | ||
var eventName, eventNames, key, value; | ||
@@ -724,5 +725,4 @@ eventNames = []; | ||
ProjectionService.prototype._applyDomainEventsFromStoreToProjection = function(projectionId, projection, eventNames, aggregateId) { | ||
ProjectionService.prototype._applyDomainEventsFromStoreToProjection = function(projection, eventNames, aggregateId) { | ||
var findEvents; | ||
this._domainEventsApplied[projectionId] = {}; | ||
if (aggregateId) { | ||
@@ -743,4 +743,2 @@ findEvents = this._context.findDomainEventsByNameAndAggregateId(eventNames, aggregateId); | ||
return _this._applyDomainEventToProjection(domainEvent, projection); | ||
}).then(function() { | ||
return _this._domainEventsApplied[projectionId][domainEvent.id] = true; | ||
}); | ||
@@ -757,8 +755,3 @@ }); | ||
return function(domainEvent) { | ||
if (_this._domainEventsApplied[projectionId][domainEvent.id]) { | ||
return; | ||
} | ||
return _this._applyDomainEventToProjection(domainEvent, projection).then(function() { | ||
_this._domainEventsApplied[projectionId][domainEvent.id] = true; | ||
}); | ||
return _this._applyDomainEventToProjection(domainEvent, projection); | ||
}; | ||
@@ -787,3 +780,3 @@ })(this); | ||
if (!projection["handle" + domainEvent.name]) { | ||
return; | ||
logger.warn("ProjectionService: handle" + domainEvent.name + " not defined"); | ||
} | ||
@@ -873,4 +866,58 @@ return projection["handle" + domainEvent.name](domainEvent); | ||
/* 13 */ | ||
/***/ function(module, exports) { | ||
module.exports = { | ||
_logLevel: 1, | ||
setLogLevel: function(logLevel) { | ||
return this._logLevel = (function() { | ||
switch (logLevel) { | ||
case 'debug': | ||
return 0; | ||
case 'warn': | ||
return 1; | ||
case 'info': | ||
return 2; | ||
case 'error': | ||
return 3; | ||
} | ||
})(); | ||
}, | ||
debug: function() { | ||
if (this._logLevel > 0) { | ||
return; | ||
} | ||
return console.log.apply(console, arguments); | ||
}, | ||
warn: function() { | ||
if (this._logLevel > 1) { | ||
return; | ||
} | ||
return console.log.apply(console, arguments); | ||
}, | ||
info: function() { | ||
if (this._logLevel > 2) { | ||
return; | ||
} | ||
return console.log.apply(console, arguments); | ||
}, | ||
error: function() { | ||
if (this._logLevel > 3) { | ||
return; | ||
} | ||
return console.log.apply(console, arguments); | ||
} | ||
}; | ||
/***/ }, | ||
/* 14 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
module.exports = __webpack_require__(15); | ||
/***/ }, | ||
/* 15 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var AggregateRepository, Context, EventBus, Projection, domainEventService, logger, | ||
@@ -880,9 +927,9 @@ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, | ||
EventBus = __webpack_require__(14); | ||
EventBus = __webpack_require__(16); | ||
Projection = __webpack_require__(8); | ||
AggregateRepository = __webpack_require__(17); | ||
AggregateRepository = __webpack_require__(19); | ||
logger = __webpack_require__(23); | ||
logger = __webpack_require__(12); | ||
@@ -1230,10 +1277,10 @@ domainEventService = __webpack_require__(5); | ||
/***/ }, | ||
/* 14 */ | ||
/* 16 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
module.exports = __webpack_require__(15); | ||
module.exports = __webpack_require__(17); | ||
/***/ }, | ||
/* 15 */ | ||
/* 17 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1243,3 +1290,3 @@ | ||
Subscriber = __webpack_require__(16); | ||
Subscriber = __webpack_require__(18); | ||
@@ -1379,3 +1426,3 @@ EventBus = (function() { | ||
/***/ }, | ||
/* 16 */ | ||
/* 18 */ | ||
/***/ function(module, exports) { | ||
@@ -1398,10 +1445,10 @@ | ||
/***/ }, | ||
/* 17 */ | ||
/* 19 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
module.exports = __webpack_require__(18); | ||
module.exports = __webpack_require__(20); | ||
/***/ }, | ||
/* 18 */ | ||
/* 20 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1412,5 +1459,5 @@ | ||
Aggregate = __webpack_require__(19); | ||
Aggregate = __webpack_require__(21); | ||
logger = __webpack_require__(23); | ||
logger = __webpack_require__(12); | ||
@@ -1534,10 +1581,10 @@ uuidGenerator = __webpack_require__(10); | ||
/***/ }, | ||
/* 19 */ | ||
/* 21 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
module.exports = __webpack_require__(20); | ||
module.exports = __webpack_require__(22); | ||
/***/ }, | ||
/* 20 */ | ||
/* 22 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1548,3 +1595,3 @@ | ||
DomainEvent = __webpack_require__(21); | ||
DomainEvent = __webpack_require__(23); | ||
@@ -1625,10 +1672,10 @@ Aggregate = (function() { | ||
/***/ }, | ||
/* 21 */ | ||
/* 23 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
module.exports = __webpack_require__(22); | ||
module.exports = __webpack_require__(24); | ||
/***/ }, | ||
/* 22 */ | ||
/* 24 */ | ||
/***/ function(module, exports) { | ||
@@ -1656,56 +1703,2 @@ | ||
/***/ }, | ||
/* 23 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
module.exports = __webpack_require__(24); | ||
/***/ }, | ||
/* 24 */ | ||
/***/ function(module, exports) { | ||
module.exports = { | ||
_logLevel: 1, | ||
setLogLevel: function(logLevel) { | ||
return this._logLevel = (function() { | ||
switch (logLevel) { | ||
case 'debug': | ||
return 0; | ||
case 'warn': | ||
return 1; | ||
case 'info': | ||
return 2; | ||
case 'error': | ||
return 3; | ||
} | ||
})(); | ||
}, | ||
debug: function() { | ||
if (this._logLevel > 0) { | ||
return; | ||
} | ||
return console.log.apply(console, arguments); | ||
}, | ||
warn: function() { | ||
if (this._logLevel > 1) { | ||
return; | ||
} | ||
return console.log.apply(console, arguments); | ||
}, | ||
info: function() { | ||
if (this._logLevel > 2) { | ||
return; | ||
} | ||
return console.log.apply(console, arguments); | ||
}, | ||
error: function() { | ||
if (this._logLevel > 3) { | ||
return; | ||
} | ||
return console.log.apply(console, arguments); | ||
} | ||
}; | ||
/***/ }, | ||
/* 25 */ | ||
@@ -1712,0 +1705,0 @@ /***/ function(module, exports) { |
@@ -13,3 +13,3 @@ { | ||
], | ||
"version": "0.24.0", | ||
"version": "0.24.1", | ||
"repository": { | ||
@@ -16,0 +16,0 @@ "type": "git", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
811087
18878