File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
packages/svelte/src/compiler/phases/3-transform/client/visitors/shared Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,7 @@ export function build_attribute_effect(
89
89
all . map ( ( { id } ) => id ) ,
90
90
b . object ( values )
91
91
) ,
92
- memoizer . sync . length > 0 &&
93
- b . array ( memoizer . sync . map ( ( { expression } ) => b . thunk ( expression ) ) ) ,
92
+ memoizer . sync_values ( ) ,
94
93
memoizer . async_values ( ) ,
95
94
element . metadata . scoped &&
96
95
context . state . analysis . css . hash !== '' &&
Original file line number Diff line number Diff line change @@ -53,6 +53,11 @@ export class Memoizer {
53
53
if ( this . async . length === 0 ) return ;
54
54
return b . array ( this . async . map ( ( memo ) => b . thunk ( memo . expression , true ) ) ) ;
55
55
}
56
+
57
+ sync_values ( ) {
58
+ if ( this . sync . length === 0 ) return ;
59
+ return b . array ( this . sync . map ( ( memo ) => b . thunk ( memo . expression ) ) ) ;
60
+ }
56
61
}
57
62
58
63
/**
@@ -169,7 +174,7 @@ export function build_render_statement(state) {
169
174
? state . update [ 0 ] . expression
170
175
: b . block ( state . update )
171
176
) ,
172
- all . length > 0 && b . array ( memoizer . sync . map ( ( { expression } ) => b . thunk ( expression ) ) ) ,
177
+ memoizer . sync_values ( ) ,
173
178
memoizer . async_values ( )
174
179
)
175
180
) ;
You can’t perform that action at this time.
0 commit comments