Usage
Signature
Auto-update variant
Manual-update variant
A single store or an array of stores to derive from.
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:The initial value of the derived store before the derivation function is first called.
A readable store containing the derived value.
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.