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';
9
9
*/
10
10
export function Attachment ( node , context ) {
11
11
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
+ )
19
21
)
20
22
)
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
+ ) ;
33
25
}
34
26
}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export function attach(node, get_fn) {
11
11
if ( Array . isArray ( attachment ) ) {
12
12
for ( const fn of attachment ) {
13
13
if ( fn ) {
14
- $ effect( ( ) => fn ( node ) ) ;
14
+ effect ( ( ) => fn ( node ) ) ;
15
15
}
16
16
}
17
17
} else if ( attachment ) {
You can’t perform that action at this time.
0 commit comments