chore: tweak flushSync implementation (#15898)

pull/15902/head
Rich Harris 4 months ago committed by GitHub
parent eebb940b31
commit 8a351944a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

Loading…
Cancel
Save