11/** @import { Effect, Source, TemplateNode } from '#client' */
2- import { is_promise , noop } from '../../../shared/utils.js' ;
2+ import { DEV } from 'esm-env' ;
3+ import { is_promise } from '../../../shared/utils.js' ;
4+ import { block , branch , pause_effect , resume_effect } from '../../reactivity/effects.js' ;
5+ import { internal_set , mutable_source , source } from '../../reactivity/sources.js' ;
36import {
47 component_context ,
58 flush_sync ,
69 is_runes ,
7- set_component_context ,
810 set_active_effect ,
911 set_active_reaction ,
12+ set_component_context ,
1013 set_dev_current_component_function
1114} from '../../runtime.js' ;
12- import { block , branch , pause_effect , resume_effect } from '../../reactivity/effects.js' ;
13- import { DEV } from 'esm-env' ;
14- import { queue_micro_task } from '../task.js' ;
1515import { hydrate_next , hydrate_node , hydrating } from '../hydration.js' ;
16- import { mutable_source , set , source } from '../../reactivity/sources .js' ;
16+ import { queue_micro_task } from '../task .js' ;
1717
1818const PENDING = 0 ;
1919const THEN = 1 ;
@@ -120,12 +120,16 @@ export function await_block(node, get_input, pending_fn, then_fn, catch_fn) {
120120 promise . then (
121121 ( value ) => {
122122 if ( promise !== input ) return ;
123- set ( input_source , value ) ;
123+ // we technically could use `set` here since it's on the next microtick
124+ // but let's use internal_set for consistency and just to be safe
125+ internal_set ( input_source , value ) ;
124126 update ( THEN , true ) ;
125127 } ,
126128 ( error ) => {
127129 if ( promise !== input ) return ;
128- set ( error_source , error ) ;
130+ // we technically could use `set` here since it's on the next microtick
131+ // but let's use internal_set for consistency and just to be safe
132+ internal_set ( error_source , error ) ;
129133 update ( CATCH , true ) ;
130134 }
131135 ) ;
@@ -142,7 +146,7 @@ export function await_block(node, get_input, pending_fn, then_fn, catch_fn) {
142146 } ) ;
143147 }
144148 } else {
145- set ( input_source , input ) ;
149+ internal_set ( input_source , input ) ;
146150 update ( THEN , false ) ;
147151 }
148152
0 commit comments