File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 55 flush_queued_effects ,
66 flush_queued_root_effects ,
77 process_effects ,
8+ queued_root_effects ,
89 schedule_effect ,
910 set_queued_root_effects ,
1011 set_signal_status ,
@@ -174,7 +175,7 @@ export class Batch {
174175 this . render_effects = [ ] ;
175176 this . effects = [ ] ;
176177
177- this . commit ( ) ;
178+ this . # commit( ) ;
178179
179180 flush_queued_effects ( render_effects ) ;
180181 flush_queued_effects ( effects ) ;
@@ -227,7 +228,11 @@ export class Batch {
227228 }
228229
229230 flush ( ) {
230- flush_queued_root_effects ( ) ;
231+ if ( queued_root_effects . length > 0 ) {
232+ flush_queued_root_effects ( ) ;
233+ } else {
234+ this . #commit( ) ;
235+ }
231236
232237 if ( current_batch !== this ) {
233238 // this can happen if a `flushSync` occurred during `flush_queued_root_effects`,
@@ -242,7 +247,7 @@ export class Batch {
242247 current_batch = null ;
243248 }
244249
245- commit ( ) {
250+ # commit( ) {
246251 for ( const fn of this . #callbacks) {
247252 fn ( ) ;
248253 }
@@ -270,8 +275,6 @@ export class Batch {
270275
271276 this . render_effects = [ ] ;
272277 this . effects = [ ] ;
273-
274- this . commit ( ) ;
275278 }
276279 }
277280
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ export function set_is_destroying_effect(value) {
6868// Handle effect queues
6969
7070/** @type {Effect[] } */
71- let queued_root_effects = [ ] ;
71+ export let queued_root_effects = [ ] ;
7272
7373/** @param {Effect[] } v */
7474export function set_queued_root_effects ( v ) {
You can’t perform that action at this time.
0 commit comments