almost all tests passing again

pull/709/head
Rich Harris 7 years ago
parent 16aaf157a0
commit 192d6e40b0

@ -234,7 +234,7 @@ export default function dom(
@template.oncreate.call( this );
}`}
${generator.hasIntroTransitions && `@callAll(this._postcreate);`}
${(generator.hasComplexBindings || generator.hasIntroTransitions) && `@callAll(this._postcreate);`}
}
@assign( ${prototypeBase}, ${proto});

@ -66,19 +66,25 @@ export default function visitBinding(
const updating = block.getUniqueName(`${local.name}_updating`);
block.addVariable(updating, 'false');
const observer = block.getUniqueName('observer');
const value = block.getUniqueName('value');
local.create.addBlock(deindent`
${local.name}.observe( '${attribute.name}', function ( value ) {
function ${observer} ( value ) {
if ( ${updating} ) return;
${updating} = true;
${setter}
${updating} = false;
}, { init: false });
if ( @differs( ${local.name}.get( '${attribute.name}' ), ${snippet} ) ) {
#component._postcreate.push( function () {
${setter}
});
}
${local.name}.observe( '${attribute.name}', ${observer}, { init: false });
#component._postcreate.push( function () {
var value = ${local.name}.get( '${attribute.name}' );
if ( @differs( value, ${snippet} ) ) {
${observer}.call( ${local.name}, value );
}
});
`);
local.update.addBlock(deindent`

Loading…
Cancel
Save