Skip to content

Commit 10b2d64

Browse files
committed
tweak
1 parent f1f34f7 commit 10b2d64

File tree

1 file changed

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

1 file changed

+2
-7
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,6 @@ export function flushSync(fn) {
450450
try {
451451
var result;
452452

453-
var batch = Batch.ensure();
454-
455453
if (fn) {
456454
flush_effects();
457455
result = fn();
@@ -461,10 +459,7 @@ export function flushSync(fn) {
461459
flush_tasks();
462460

463461
if (queued_root_effects.length === 0) {
464-
// TODO this might need adjustment
465-
if (batch === current_batch) {
466-
batch.flush();
467-
}
462+
current_batch?.flush();
468463

469464
// TODO this feels wrong
470465
if (queued_root_effects.length === 0) {
@@ -492,7 +487,7 @@ function flush_effects() {
492487
set_is_updating_effect(true);
493488

494489
while (queued_root_effects.length > 0) {
495-
var batch = /** @type {Batch} */ (current_batch);
490+
var batch = Batch.ensure();
496491

497492
if (flush_count++ > 1000) {
498493
if (DEV) {

0 commit comments

Comments
 (0)