Skip to content

computedAsync Type documentation

<T, R> (options: ComputedAsyncOptions<T, R>) => Signal<T>
Function
Computed value, but async. This exists because the resource() API is not suitable. During loading, the value changes to undefined . The proposed solution of resource snapshots and a withPreviousValue() function that uses resourceFromSnapshots() isn't suitable either because it's experimental.
Returns readonly signal
Parameters
the options
options: ComputedAsyncOptions<T, R>

Types Documentation

Options for computedAsync()
Properties
Computation function. This is untracked() , params from the params function are passed
computation: (params: R) => Promise<T>
Initial value of the computedAsync signal.
initial: T
Params function, params will be passed to the computation function. This is tracked.
params: () => R

Except where otherwise noted, content on this site is licensed under MIT License.