@ -134,7 +134,7 @@ export default function visitBinding(
block . addVariable ( last , 'true' ) ;
updateCondition = ` ${ last } !== ( ${ last } = ${ snippet } ) ` ;
updateElement = ` ${ state . parentNode } [ ${ last } ? 'pause' : 'play' ]();` ;
updateElement = ` ${ state . parentNode } [ ${ last } ? "pause" : "play" ]();` ;
}
}
@ -149,21 +149,21 @@ export default function visitBinding(
if ( node . name === 'input' && type === 'range' ) {
// need to bind to `input` and `change`, for the benefit of IE
block . builders . hydrate . addBlock ( deindent `
@addListener ( $ { state . parentNode } , 'input' , $ { handler } ) ;
@addListener ( $ { state . parentNode } , 'change' , $ { handler } ) ;
@addListener ( $ { state . parentNode } , "input" , $ { handler } ) ;
@addListener ( $ { state . parentNode } , "change" , $ { handler } ) ;
` );
block . builders . destroy . addBlock ( deindent `
@removeListener ( $ { state . parentNode } , 'input' , $ { handler } ) ;
@removeListener ( $ { state . parentNode } , 'change' , $ { handler } ) ;
@removeListener ( $ { state . parentNode } , "input" , $ { handler } ) ;
@removeListener ( $ { state . parentNode } , "change" , $ { handler } ) ;
` );
} else {
block . builders . hydrate . addLine (
` @addListener( ${ state . parentNode } , '${ eventName } ', ${ handler } );`
` @addListener( ${ state . parentNode } , "${ eventName } ", ${ handler } );`
) ;
block . builders . destroy . addLine (
` @removeListener( ${ state . parentNode } , '${ eventName } ', ${ handler } );`
` @removeListener( ${ state . parentNode } , "${ eventName } ", ${ handler } );`
) ;
}
@ -183,10 +183,10 @@ export default function visitBinding(
if ( attribute . name === 'paused' ) {
block . builders . create . addLine (
` @addListener( ${ state . parentNode } , 'play', ${ handler } );`
` @addListener( ${ state . parentNode } , "play", ${ handler } );`
) ;
block . builders . destroy . addLine (
` @removeListener( ${ state . parentNode } , 'play', ${ handler } );`
` @removeListener( ${ state . parentNode } , "play", ${ handler } );`
) ;
}
}
@ -286,12 +286,8 @@ function getSetter(
list [ index ] $ { tail } = $ { value } ;
$ { computed
? ` #component.set({ ${ dependencies
. map ( ( prop : string ) = > ` ${ prop } : state. ${ prop } ` )
. join ( ', ' ) } } ) ; `
: ` #component.set({ ${ dependencies
. map ( ( prop : string ) = > ` ${ prop } : #component.get( ' ${ prop } ' ) ` )
. join ( ', ' ) } } ) ; ` }
? ` #component.set({ ${ dependencies . map ( ( prop : string ) = > ` ${ prop } : state. ${ prop } ` ) . join ( ', ' ) } }); `
: ` #component.set({ ${ dependencies . map ( ( prop : string ) = > ` ${ prop } : #component.get(' ${ prop } ') ` ) . join ( ', ' ) } }); ` }
` ;
}
@ -299,9 +295,7 @@ function getSetter(
return deindent `
var state = # component . get ( ) ;
$ { snippet } = $ { value } ;
# component . set ( { $ { dependencies
. map ( ( prop : string ) = > ` ${ prop } : state. ${ prop } ` )
. join ( ', ' ) } } ) ;
# component . set ( { $ { dependencies . map ( ( prop : string ) = > ` ${ prop } : state. ${ prop } ` ) . join ( ', ' ) } } ) ;
` ;
}