Skip to content

Commit 1bdc518

Browse files
committed
fix
1 parent 49e1ab5 commit 1bdc518

File tree

1 file changed

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

1 file changed

+13
-3
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,22 @@ export class Batch {
330330

331331
for (const batch of batches) {
332332
if (batch === this) {
333-
is_earlier = true;
333+
is_earlier = false;
334334
continue;
335335
}
336336

337-
for (const source of this.current.keys()) {
338-
if (is_earlier && batch.current.has(source)) continue;
337+
for (const [source, value] of this.current) {
338+
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+
339349
mark_effects(source);
340350
}
341351

0 commit comments

Comments
 (0)