File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -528,6 +528,22 @@ export function update_effect(effect) {
528
528
effect . teardown = typeof teardown === 'function' ? teardown : null ;
529
529
effect . version = current_version ;
530
530
531
+ var version = current_version ;
532
+ var deps = effect . deps ;
533
+
534
+ // In DEV, we need to handle a case where $inspect.trace() might
535
+ // incorrectly state a source dependency has not changed when it has.
536
+ // That's beacuse that source was changed by the same effect, causing
537
+ // the versions to match. We can avoid this by incrementing the version
538
+ if ( DEV && ( effect . f & DIRTY ) !== 0 && deps !== null ) {
539
+ for ( let i = 0 ; i < deps . length ; i ++ ) {
540
+ var dep = deps [ i ] ;
541
+ if ( ( dep . f & DERIVED ) === 0 && dep . version === version ) {
542
+ dep . version = increment_version ( ) ;
543
+ }
544
+ }
545
+ }
546
+
531
547
if ( DEV ) {
532
548
dev_effect_stack . push ( effect ) ;
533
549
}
You can’t perform that action at this time.
0 commit comments