File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ export function async_derived(fn) {
140140 // TODO we should probably null out active effect here,
141141 // rather than inside `restore()`
142142 }
143- } ) ;
143+ } , EFFECT_HAS_DERIVED ) ;
144144
145145 return Promise . resolve ( promise ) . then ( ( ) => value ) ;
146146}
Original file line number Diff line number Diff line change @@ -997,18 +997,14 @@ export function get(signal) {
997997 } else {
998998 // we're adding a dependency outside the init/update cycle
999999 // (i.e. after an `await`)
1000- // TODO we probably want to disable this for user effects,
1001- // otherwise it's a breaking change, albeit a desirable one?
1002- if ( deps === null ) {
1003- deps = [ signal ] ;
1004- } else if ( ! deps . includes ( signal ) ) {
1005- deps . push ( signal ) ;
1006- }
1000+ ( active_reaction . deps ??= [ ] ) . push ( signal ) ;
1001+
1002+ var reactions = signal . reactions ;
10071003
1008- if ( signal . reactions === null ) {
1004+ if ( reactions === null ) {
10091005 signal . reactions = [ active_reaction ] ;
1010- } else if ( ! signal . reactions . includes ( active_reaction ) ) {
1011- signal . reactions . push ( active_reaction ) ;
1006+ } else if ( ! reactions . includes ( active_reaction ) ) {
1007+ reactions . push ( active_reaction ) ;
10121008 }
10131009 }
10141010 } else if (
You can’t perform that action at this time.
0 commit comments