-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Description
Describe the bug
According to:
https://svelte.dev/docs/svelte/runtime-warnings#Client-warnings-await_waterfall
You can start concurrent promises by creating them prior to awaiting them, on paper this seems fine however $derived values are lazy meaning it can't really work conceptually:
let aPromise = $derived(one());
let bPromise = $derived(two());
// at this point one() and two() have not been called yet
let a = $derived(await aPromise); // aPromise is evaluated, one() is called (async derived is eager)
let b = $derived(await bPromise); // bPromise is only evaluated once `a` is done
forcing evaluation of the derived values "fixes this" (e.g $inspect(aPromise, bPromise)
), but that is a bit dumb.
What is the expected behavior here?
Reproduction
https://svelte.dev/playground/d3a249ca4fd44e24b6f83e66375cbc22?version=5.36.13
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels