File tree Expand file tree Collapse file tree 2 files changed +12
-20
lines changed
compiler/phases/3-transform/client/visitors
internal/client/dom/elements Expand file tree Collapse file tree 2 files changed +12
-20
lines changed Original file line number Diff line number Diff line change @@ -9,26 +9,18 @@ import * as b from '../../../../utils/builders.js';
99 */
1010export function Attachment ( node , context ) {
1111 for ( const attachment of node . attachments ) {
12- if ( attachment . type === 'SpreadElement' ) {
13- context . state . init . push (
14- b . stmt (
15- b . call (
16- '$.attach_all' ,
17- context . state . node ,
18- b . thunk ( /** @type {Expression } */ ( context . visit ( attachment . argument ) ) )
12+ context . state . init . push (
13+ b . stmt (
14+ b . call (
15+ '$.attach' ,
16+ context . state . node ,
17+ b . thunk (
18+ /** @type {Expression } */ (
19+ context . visit ( attachment . type === 'SpreadElement' ? attachment . argument : attachment )
20+ )
1921 )
2022 )
21- ) ;
22- } else {
23- context . state . init . push (
24- b . stmt (
25- b . call (
26- '$.attach' ,
27- context . state . node ,
28- b . thunk ( /** @type {Expression } */ ( context . visit ( attachment ) ) )
29- )
30- )
31- ) ;
32- }
23+ )
24+ ) ;
3325 }
3426}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export function attach(node, get_fn) {
1111 if ( Array . isArray ( attachment ) ) {
1212 for ( const fn of attachment ) {
1313 if ( fn ) {
14- $ effect( ( ) => fn ( node ) ) ;
14+ effect ( ( ) => fn ( node ) ) ;
1515 }
1616 }
1717 } else if ( attachment ) {
You can’t perform that action at this time.
0 commit comments