File tree Expand file tree Collapse file tree 1 file changed +15
-19
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 1 file changed +15
-19
lines changed Original file line number Diff line number Diff line change @@ -763,7 +763,21 @@ function flush_queued_effects(effects) {
763763 * @returns {void }
764764 */
765765export function schedule_effect ( signal ) {
766- queue_flush ( ) ;
766+ if ( ! is_flushing ) {
767+ is_flushing = true ;
768+ queueMicrotask ( ( ) => {
769+ flush_queued_root_effects ( ) ;
770+
771+ // TODO this doesn't seem quite right — may run into
772+ // interesting cases where there are multiple roots.
773+ // it'll do for now though
774+ if ( active_fork ?. pending === 0 ) {
775+ active_fork . remove ( ) ;
776+ }
777+
778+ remove_active_fork ( ) ;
779+ } ) ;
780+ }
767781
768782 var effect = ( last_scheduled_effect = signal ) ;
769783
@@ -788,24 +802,6 @@ export function schedule_effect(signal) {
788802 }
789803}
790804
791- function queue_flush ( ) {
792- if ( ! is_flushing ) {
793- is_flushing = true ;
794- queueMicrotask ( ( ) => {
795- flush_queued_root_effects ( ) ;
796-
797- // TODO this doesn't seem quite right — may run into
798- // interesting cases where there are multiple roots.
799- // it'll do for now though
800- if ( active_fork ?. pending === 0 ) {
801- active_fork . remove ( ) ;
802- }
803-
804- remove_active_fork ( ) ;
805- } ) ;
806- }
807- }
808-
809805/**
810806 *
811807 * This function both runs render effects and collects user effects in topological order
You can’t perform that action at this time.
0 commit comments