Usage
Signature
Auto-update variant
Manual-update variant
Readable<any> | Array<Readable<any>>
A single store or an array of stores to derive from.
Function
The derivation function. Has two variants:Auto-update: If the function has fewer than 2 parameters, the return value becomes the derived value:Manual-update: If the function has 2 or more parameters, it receives
set and update callbacks and can return a cleanup function:T
The initial value of the derived store before the derivation function is first called.
object
A readable store containing the derived value.
(run: Subscriber<T>, invalidate?: () => void) => Unsubscriber
Subscribe to value changes. The
run callback is called immediately with the current value and then called again whenever any of the input stores change.Returns an unsubscriber function.