rename postcreate to aftercreate

pull/709/head
Rich Harris 8 years ago
parent 05a27c5fb2
commit 3f65b8b38f

@ -212,7 +212,7 @@ export default function dom(
// this._bindings = []; // this._bindings = [];
this._beforecreate = []; this._beforecreate = [];
this._oncreate = [${templateProperties.oncreate && `oncreate`}]; this._oncreate = [${templateProperties.oncreate && `oncreate`}];
this._postcreate = []; this._aftercreate = [];
} }
${templateProperties.oncreate && deindent` ${templateProperties.oncreate && deindent`
@ -239,7 +239,7 @@ export default function dom(
@callAll(this._beforecreate); @callAll(this._beforecreate);
@callAll(this._oncreate); @callAll(this._oncreate);
@callAll(this._postcreate); @callAll(this._aftercreate);
} }
@assign( ${prototypeBase}, ${proto}); @assign( ${prototypeBase}, ${proto});

@ -23,7 +23,7 @@ export default function addTransitions(
const fn = `@template.transitions.${intro.name}`; const fn = `@template.transitions.${intro.name}`;
block.builders.intro.addBlock(deindent` block.builders.intro.addBlock(deindent`
#component._root._postcreate.push( function () { #component._root._aftercreate.push( function () {
if ( !${name} ) ${name} = @wrapTransition( #component, ${state.name}, ${fn}, ${snippet}, true, null ); if ( !${name} ) ${name} = @wrapTransition( #component, ${state.name}, ${fn}, ${snippet}, true, null );
${name}.run( true, function () { ${name}.run( true, function () {
#component.fire( 'intro.end', { node: ${state.name} }); #component.fire( 'intro.end', { node: ${state.name} });
@ -58,7 +58,7 @@ export default function addTransitions(
} }
block.builders.intro.addBlock(deindent` block.builders.intro.addBlock(deindent`
#component._root._postcreate.push( function () { #component._root._aftercreate.push( function () {
${introName} = @wrapTransition( #component, ${state.name}, ${fn}, ${snippet}, true, null ); ${introName} = @wrapTransition( #component, ${state.name}, ${fn}, ${snippet}, true, null );
${introName}.run( true, function () { ${introName}.run( true, function () {
#component.fire( 'intro.end', { node: ${state.name} }); #component.fire( 'intro.end', { node: ${state.name} });

@ -108,7 +108,7 @@ export function set(newState) {
this._set(assign({}, newState)); this._set(assign({}, newState));
callAll(this._root._beforecreate); callAll(this._root._beforecreate);
callAll(this._root._oncreate); callAll(this._root._oncreate);
callAll(this._root._postcreate); callAll(this._root._aftercreate);
} }
export function callAll(fns) { export function callAll(fns) {

Loading…
Cancel
Save