Skip to content

Commit f89e355

Browse files
committed
restrict to block effects
1 parent acc7bb3 commit f89e355

File tree

1 file changed

+3
-2
lines changed
  • packages/svelte/src/internal/client/reactivity

1 file changed

+3
-2
lines changed

packages/svelte/src/internal/client/reactivity/sources.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ export function increment(source) {
300300
}
301301

302302
/**
303-
* We increment this value when an effect is scheduled as a result of a state change
303+
* We increment this value when a block effect is scheduled as a result of a state change,
304+
* as its currently-scheduled child effects may need to be destroyed
304305
*/
305306
export let schedule_version = 0;
306307

@@ -339,7 +340,7 @@ function mark_reactions(signal, status) {
339340
if ((flags & DERIVED) !== 0) {
340341
mark_reactions(/** @type {Derived} */ (reaction), MAYBE_DIRTY);
341342
} else if (not_dirty) {
342-
schedule_version += 1;
343+
if ((flags & BLOCK_EFFECT) !== 0) schedule_version += 1;
343344
schedule_effect(/** @type {Effect} */ (reaction));
344345
}
345346
}

0 commit comments

Comments
 (0)