Skip to content
Merged
5 changes: 5 additions & 0 deletions .changeset/polite-melons-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

chore: avoid microtasks when flushing sync
4 changes: 4 additions & 0 deletions packages/svelte/src/internal/client/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,8 @@ export function flushSync(fn) {
if (fn) {
is_flushing = true;
flush_queued_root_effects();

is_flushing = true;
result = fn();
}

Expand All @@ -831,6 +833,8 @@ export function flushSync(fn) {
while (queued_root_effects.length > 0) {
is_flushing = true;
flush_queued_root_effects();

is_flushing = true;
flush_tasks();
}

Expand Down
Loading