chore: simplify await blocks (#9802)

We never pass a signal to await blocks currently, so the "is_signal" check is unnecessary
pull/9806/head
Rich Harris 2 years ago committed by GitHub
parent 9babce9105
commit 4b76c6998b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1726,7 +1726,7 @@ export function component(anchor_node, component_fn, render_fn) {
/**
* @template V
* @param {Comment} anchor_node
* @param {import('./types.js').Signal<Promise<V>> | Promise<V> | (() => Promise<V>)} input
* @param {(() => Promise<V>)} input
* @param {null | ((anchor: Node) => void)} pending_fn
* @param {null | ((anchor: Node, value: V) => void)} then_fn
* @param {null | ((anchor: Node, error: unknown) => void)} catch_fn
@ -1834,7 +1834,7 @@ function await_block(anchor_node, input, pending_fn, then_fn, catch_fn) {
() => {
const token = {};
latest_token = token;
const promise = is_signal(input) ? get(input) : typeof input === 'function' ? input() : input;
const promise = input();
if (is_promise(promise)) {
promise.then(
/** @param {V} v */

Loading…
Cancel
Save