From 909015a34e8e9c42a69d850fb55e8f077536f9fb Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 6 Jun 2018 18:03:21 -0400 Subject: [PATCH] fix for #1522... maybe? --- src/compile/dom/index.ts | 3 ++- test/runtime/samples/onstate-before-render/_config.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compile/dom/index.ts b/src/compile/dom/index.ts index 0a02b664be..6baa397241 100644 --- a/src/compile/dom/index.ts +++ b/src/compile/dom/index.ts @@ -222,11 +222,12 @@ export default function dom( ${compiler.slots.size && `this.slots = {};`} + ${templateProperties.onstate && `%onstate.call(this, { changed: @assignTrue({}, this._state), current: this._state });`} + this._fragment = @create_main_fragment(this, this._state); ${hasInitHooks && deindent` this.root._oncreate.push(() => { - ${templateProperties.onstate && `%onstate.call(this, { changed: @assignTrue({}, this._state), current: this._state });`} ${templateProperties.oncreate && `%oncreate.call(this);`} this.fire("update", { changed: @assignTrue({}, this._state), current: this._state }); }); diff --git a/test/runtime/samples/onstate-before-render/_config.js b/test/runtime/samples/onstate-before-render/_config.js index 56e30077bd..97c3af5083 100644 --- a/test/runtime/samples/onstate-before-render/_config.js +++ b/test/runtime/samples/onstate-before-render/_config.js @@ -10,5 +10,7 @@ export default { 'oncreate', 'onupdate' ]); + + order.length = 0; } };