diff --git a/js/examples/todo/index.js b/js/examples/todo/index.js index 851fe7c..e8b1df7 100644 --- a/js/examples/todo/index.js +++ b/js/examples/todo/index.js @@ -61,10 +61,6 @@ function todoListItemView(id) { this.editing = false; react { during todo(id, $title, $completed) { - // BUG: terminate() kills off the during show subfacet - // entirely?!?! Yes, it should kill "its" children - but which - // are its children? We need some way of distinguishing by - // instantiation. during show(completed) { assert this.ui.html('.todo-list', Mustache.render(getTemplate(this.editing diff --git a/js/src/actor.js b/js/src/actor.js index 0a5995a..f337e31 100644 --- a/js/src/actor.js +++ b/js/src/actor.js @@ -149,18 +149,18 @@ Facet.prototype.onEvent = function(isTerminal, eventType, subscriptionFn, projec : e.patch.removed, spec); if (objects && objects.size > 0) { - facet.actor.pushAction(function () { - var shouldTerminate = isTerminal; - objects.forEach(function (o) { - var instantiated = Trie.instantiateProjection(spec, o); - if (facet.interestWas(eventType, instantiated)) { - if (shouldTerminate) { - shouldTerminate = false; - facet.terminate(); - } - Util.kwApply(handlerFn, facet.actor.state, o); + var shouldTerminate = isTerminal; + objects.forEach(function (o) { + var instantiated = Trie.instantiateProjection(spec, o); + if (facet.interestWas(eventType, instantiated)) { + if (shouldTerminate) { + shouldTerminate = false; + facet.terminate(); } - }); + facet.actor.pushAction(function () { + Util.kwApply(handlerFn, facet.actor.state, o); + }); + } }); } }