Hoist .refresh out from .handleEvent; makes assertions depend on state that might have been changed in event handlers properly.
This commit is contained in:
parent
a433a054b8
commit
6d305e6b00
|
@ -31,6 +31,9 @@ Actor.prototype.handleEvent = function(e) {
|
|||
this.facets.forEach(function (f) {
|
||||
withCurrentFacet(f, function () { f.handleEvent(e); });
|
||||
});
|
||||
this.facets.forEach(function (f) {
|
||||
withCurrentFacet(f, function () { f.refresh(); });
|
||||
});
|
||||
this.checkForTermination();
|
||||
};
|
||||
|
||||
|
@ -84,7 +87,6 @@ Facet.prototype.handleEvent = function(e) {
|
|||
facet.endpoints.forEach(function(endpoint) {
|
||||
endpoint.handlerFn.call(facet.actor.state, e);
|
||||
});
|
||||
facet.refresh();
|
||||
};
|
||||
|
||||
Facet.prototype.addAssertion = function(assertionFn) {
|
||||
|
|
Loading…
Reference in New Issue