Skip to content

Commit c45b60c

Browse files
committed
make flush_sync non-recursive
1 parent 99033bd commit c45b60c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/svelte/src/internal/client/runtime.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,8 +834,10 @@ export function flush_sync(fn) {
834834
var result = fn?.();
835835

836836
flush_tasks();
837-
if (queued_root_effects.length > 0) {
838-
flush_sync();
837+
838+
while (queued_root_effects.length > 0) {
839+
flush_queued_root_effects();
840+
flush_tasks();
839841
}
840842

841843
return result;

0 commit comments

Comments
 (0)