API
function linkedSignal<D>(computation: () => D, options?: { equal?: ValueEqualityFn<NoInfer<D>> | undefined; } | undefined): WritableSignal<D>;
Creates a writable signals whose value is initialized and reset by the linked, reactive computation.
@paramcomputation
() => D
@returns
WritableSignal<D>
function linkedSignal<S, D>(options: { source: () => S; computation: (source: NoInfer<S>, previous?: { source: NoInfer<S>; value: NoInfer<D>; } | undefined) => D; equal?: ValueEqualityFn<NoInfer<D>> | undefined; }): WritableSignal<D>;
Creates a writable signals whose value is initialized and reset by the linked, reactive computation. This is an advanced API form where the computation has access to the previous value of the signal and the computation result.
@paramoptions
{ source: () => S; computation: (source: NoInfer<S>, previous?: { source: NoInfer<S>; value: NoInfer<D>; } | undefined) => D; equal?: ValueEqualityFn<NoInfer<D>> | undefined; }
@returns
WritableSignal<D>
Jump to details