There was an error while loading. Please reload this page.
1 parent 49e1ab5 commit 1bdc518Copy full SHA for 1bdc518
packages/svelte/src/internal/client/reactivity/batch.js
@@ -330,12 +330,22 @@ export class Batch {
330
331
for (const batch of batches) {
332
if (batch === this) {
333
-is_earlier = true;
+is_earlier = false;
334
continue;
335
}
336
337
-for (const source of this.current.keys()) {
338
-if (is_earlier && batch.current.has(source)) continue;
+for (const [source, value] of this.current) {
+if (batch.current.has(source)) {
339
+if (is_earlier) {
340
+// bring the value up to date
341
+batch.current.set(source, value);
342
+} else {
343
+// later batch has more recent value,
344
+// no need to re-run these effects
345
+continue;
346
+}
347
348
+
349
mark_effects(source);
350
351
0 commit comments