1
1
import { is_promise , noop } from '../../../shared/utils.js' ;
2
2
import {
3
3
current_component_context ,
4
- current_effect ,
5
- current_reaction ,
6
4
flush_sync ,
7
5
set_current_component_context ,
8
6
set_current_effect ,
9
7
set_current_reaction ,
10
8
set_dev_current_component_function
11
9
} from '../../runtime.js' ;
12
- import {
13
- block ,
14
- branch ,
15
- destroy_effect ,
16
- pause_effect ,
17
- resume_effect
18
- } from '../../reactivity/effects.js' ;
19
- import { INERT } from '../../constants.js' ;
10
+ import { block , branch , pause_effect , resume_effect } from '../../reactivity/effects.js' ;
20
11
import { DEV } from 'esm-env' ;
21
12
import { queue_micro_task } from '../task.js' ;
22
13
import { hydrating } from '../hydration.js' ;
@@ -36,28 +27,25 @@ const CATCH = 2;
36
27
* @returns {void }
37
28
*/
38
29
export function await_block ( anchor , get_input , pending_fn , then_fn , catch_fn ) {
39
- const component_context = current_component_context ;
40
- /** @type {any } */
41
- let component_function ;
42
- if ( DEV ) {
43
- component_function = component_context ?. function ?? null ;
44
- }
30
+ var component_context = current_component_context ;
45
31
46
32
/** @type {any } */
47
- let input ;
33
+ var component_function = DEV ? component_context ?. function : null ;
48
34
49
- let input_source = source ( /** @type {V } */ ( undefined ) ) ;
50
- let error_source = source ( undefined ) ;
35
+ /** @type {V | Promise<V> } */
36
+ var input ;
51
37
52
38
/** @type {import('#client').Effect | null } */
53
- let pending_effect ;
39
+ var pending_effect ;
54
40
55
41
/** @type {import('#client').Effect | null } */
56
- let then_effect ;
42
+ var then_effect ;
57
43
58
44
/** @type {import('#client').Effect | null } */
59
- let catch_effect ;
45
+ var catch_effect ;
60
46
47
+ var input_source = source ( /** @type {V } */ ( undefined ) ) ;
48
+ var error_source = source ( undefined ) ;
61
49
var resolved = false ;
62
50
63
51
/**
@@ -113,11 +101,11 @@ export function await_block(anchor, get_input, pending_fn, then_fn, catch_fn) {
113
101
}
114
102
}
115
103
116
- const effect = block ( ( ) => {
104
+ var effect = block ( ( ) => {
117
105
if ( input === ( input = get_input ( ) ) ) return ;
118
106
119
107
if ( is_promise ( input ) ) {
120
- const promise = input ;
108
+ var promise = input ;
121
109
122
110
resolved = false ;
123
111
0 commit comments