|
|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
/** @import { Effect, Source, TemplateNode } from '#client' */
|
|
|
|
|
import { is_promise, noop } from '../../../shared/utils.js';
|
|
|
|
|
import {
|
|
|
|
|
current_component_context,
|
|
|
|
|
@ -11,7 +12,7 @@ import {
|
|
|
|
|
import { block, branch, pause_effect, resume_effect } from '../../reactivity/effects.js';
|
|
|
|
|
import { DEV } from 'esm-env';
|
|
|
|
|
import { queue_micro_task } from '../task.js';
|
|
|
|
|
import { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from '../hydration.js';
|
|
|
|
|
import { hydrate_next, hydrate_node, hydrating } from '../hydration.js';
|
|
|
|
|
import { mutable_source, set, source } from '../../reactivity/sources.js';
|
|
|
|
|
|
|
|
|
|
const PENDING = 0;
|
|
|
|
|
@ -20,10 +21,10 @@ const CATCH = 2;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {Comment} anchor
|
|
|
|
|
* @param {TemplateNode} anchor
|
|
|
|
|
* @param {(() => Promise<V>)} get_input
|
|
|
|
|
* @param {null | ((anchor: Node) => void)} pending_fn
|
|
|
|
|
* @param {null | ((anchor: Node, value: import('#client').Source<V>) => void)} then_fn
|
|
|
|
|
* @param {null | ((anchor: Node, value: Source<V>) => void)} then_fn
|
|
|
|
|
* @param {null | ((anchor: Node, error: unknown) => void)} catch_fn
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
@ -41,13 +42,13 @@ export function await_block(anchor, get_input, pending_fn, then_fn, catch_fn) {
|
|
|
|
|
/** @type {V | Promise<V>} */
|
|
|
|
|
var input;
|
|
|
|
|
|
|
|
|
|
/** @type {import('#client').Effect | null} */
|
|
|
|
|
/** @type {Effect | null} */
|
|
|
|
|
var pending_effect;
|
|
|
|
|
|
|
|
|
|
/** @type {import('#client').Effect | null} */
|
|
|
|
|
/** @type {Effect | null} */
|
|
|
|
|
var then_effect;
|
|
|
|
|
|
|
|
|
|
/** @type {import('#client').Effect | null} */
|
|
|
|
|
/** @type {Effect | null} */
|
|
|
|
|
var catch_effect;
|
|
|
|
|
|
|
|
|
|
var input_source = runes
|
|
|
|
|
|