Skip to content

Commit 99dcc68

Browse files
committed
tidy up
1 parent 2bb5ebd commit 99dcc68

File tree

1 file changed

+12
-24
lines changed
  • packages/svelte/src/internal/client/dom/blocks

1 file changed

+12
-24
lines changed

packages/svelte/src/internal/client/dom/blocks/await.js

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
import { is_promise, noop } from '../../../shared/utils.js';
22
import {
33
current_component_context,
4-
current_effect,
5-
current_reaction,
64
flush_sync,
75
set_current_component_context,
86
set_current_effect,
97
set_current_reaction,
108
set_dev_current_component_function
119
} 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';
2011
import { DEV } from 'esm-env';
2112
import { queue_micro_task } from '../task.js';
2213
import { hydrating } from '../hydration.js';
@@ -36,28 +27,25 @@ const CATCH = 2;
3627
* @returns {void}
3728
*/
3829
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;
4531

4632
/** @type {any} */
47-
let input;
33+
var component_function = DEV ? component_context?.function : null;
4834

49-
let input_source = source(/** @type {V} */ (undefined));
50-
let error_source = source(undefined);
35+
/** @type {V | Promise<V>} */
36+
var input;
5137

5238
/** @type {import('#client').Effect | null} */
53-
let pending_effect;
39+
var pending_effect;
5440

5541
/** @type {import('#client').Effect | null} */
56-
let then_effect;
42+
var then_effect;
5743

5844
/** @type {import('#client').Effect | null} */
59-
let catch_effect;
45+
var catch_effect;
6046

47+
var input_source = source(/** @type {V} */ (undefined));
48+
var error_source = source(undefined);
6149
var resolved = false;
6250

6351
/**
@@ -113,11 +101,11 @@ export function await_block(anchor, get_input, pending_fn, then_fn, catch_fn) {
113101
}
114102
}
115103

116-
const effect = block(() => {
104+
var effect = block(() => {
117105
if (input === (input = get_input())) return;
118106

119107
if (is_promise(input)) {
120-
const promise = input;
108+
var promise = input;
121109

122110
resolved = false;
123111

0 commit comments

Comments
 (0)