Skip to content

chore: avoid microtasks when flushing sync (alternative) #15895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 12, 2025
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
2 changes: 2 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 Down