1
1
/** @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' ;
3
6
import {
4
7
component_context ,
5
8
flush_sync ,
6
9
is_runes ,
7
- set_component_context ,
8
10
set_active_effect ,
9
11
set_active_reaction ,
12
+ set_component_context ,
10
13
set_dev_current_component_function
11
14
} 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' ;
15
15
import { 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' ;
17
17
18
18
const PENDING = 0 ;
19
19
const THEN = 1 ;
@@ -120,12 +120,16 @@ export function await_block(node, get_input, pending_fn, then_fn, catch_fn) {
120
120
promise . then (
121
121
( value ) => {
122
122
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 ) ;
124
126
update ( THEN , true ) ;
125
127
} ,
126
128
( error ) => {
127
129
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 ) ;
129
133
update ( CATCH , true ) ;
130
134
}
131
135
) ;
@@ -142,7 +146,7 @@ export function await_block(node, get_input, pending_fn, then_fn, catch_fn) {
142
146
} ) ;
143
147
}
144
148
} else {
145
- set ( input_source , input ) ;
149
+ internal_set ( input_source , input ) ;
146
150
update ( THEN , false ) ;
147
151
}
148
152
0 commit comments