use existing node.initialUpdate mechanism

pull/506/head
Rich-Harris 8 years ago
parent 634ea662d3
commit 1dfd72cc28

@ -120,12 +120,6 @@ export default function visitBinding ( generator, block, state, node, attribute
${generator.helper( 'addEventListener' )}( ${state.parentNode}, '${eventName}', ${handler} );
` );
if ( node.name === 'select' ) {
block.builders.create.addBlock( deindent`
${updateElement}
` );
}
if ( node.name !== 'audio' && node.name !== 'video' ) node.initialUpdate = updateElement;
if ( updateCondition !== null ) {

@ -112,10 +112,6 @@ export default function visitElement ( generator, block, state, node ) {
visit( generator, block, childState, child );
});
if ( node.initialUpdate ) {
block.builders.create.addBlock( node.initialUpdate );
}
if ( node.lateUpdate ) {
block.builders.update.addLine( node.lateUpdate );
}
@ -124,6 +120,10 @@ export default function visitElement ( generator, block, state, node ) {
const visitor = selectValueAttribute.type === 'Attribute' ? visitAttribute : visitBinding;
visitor( generator, block, childState, node, selectValueAttribute );
}
if ( node.initialUpdate ) {
block.builders.create.addBlock( node.initialUpdate );
}
}
function getRenderStatement ( generator, namespace, name ) {

Loading…
Cancel
Save