chore: avoid microtasks when flushing sync

flush-sync
Dominic Gannaway 5 months ago
parent 479cf5d36d
commit 359dc169d5

@ -832,15 +832,15 @@ export function flushSync(fn) {
flush_queued_root_effects(); flush_queued_root_effects();
result = fn(); result = fn();
} }
flush_tasks(); flush_tasks();
while (queued_root_effects.length > 0) { while (queued_root_effects.length > 0) {
is_flushing = true; is_flushing = true;
flush_queued_root_effects(); flush_queued_root_effects();
flush_tasks(); flush_tasks();
} }
return /** @type {T} */ (result); return /** @type {T} */ (result);
} finally { } finally {
is_flushing_sync = previously_flushing_sync; is_flushing_sync = previously_flushing_sync;

Loading…
Cancel
Save