Skip to content

Commit 4126a8d

Browse files
committed
on second thoughts
1 parent eac029c commit 4126a8d

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,12 +416,12 @@ export class Batch {
416416
return (this.#deferred ??= deferred()).promise;
417417
}
418418

419-
static ensure(in_flush_sync = false) {
419+
static ensure(autoflush = true) {
420420
if (current_batch === null) {
421421
const batch = (current_batch = new Batch());
422422
batches.add(current_batch);
423423

424-
if (!in_flush_sync) {
424+
if (autoflush) {
425425
queueMicrotask(() => {
426426
if (current_batch !== batch) {
427427
// a flushSync happened in the meantime
@@ -451,7 +451,7 @@ export function flushSync(fn) {
451451

452452
var result;
453453

454-
const batch = Batch.ensure(true);
454+
const batch = Batch.ensure(false);
455455

456456
if (fn) {
457457
batch.flush_effects();

0 commit comments

Comments
 (0)