Function derived
- derived<S, T>(stores, fn, initial_value?): Readable<T>
Type Parameters
- S extends Stores
- T
Parameters
- stores: S
- fn: ((values: StoresValues<S>, set: ((value: T) => void), update: ((fn: Updater<T>) => void)) => void | Unsubscriber)
- (values, set, update): void | Unsubscriber
Parameters
Returns void | Unsubscriber
Optional
initial_value: T
Returns Readable<T>
- derived<S, T>(stores, fn, initial_value?): Readable<T>
Derived value store by synchronizing one or more readable stores and applying an aggregation function over its input values.
Type Parameters
- S extends Stores
- T
Parameters
- stores: S
- fn: ((values: StoresValues<S>) => T)
- (values): T
Parameters
- values: StoresValues<S>
Returns T
Optional
initial_value: T
Returns Readable<T>
Derived value store by synchronizing one or more readable stores and applying an aggregation function over its input values.
https://svelte.dev/docs/svelte-store#derived