Function writableDerived
- writable
Derived <S, T>(origins, derive, reflect, initial?): Writable<T> Type Parameters
- S extends Stores
- T
Parameters
- origins: S
One or more stores to derive from. Same as
derived
's 1st parameter. - derive: ((values: StoresValues<S>) => T)
The callback to determine the derived value. Same as
derived
's 2nd parameter.- (values): T
Parameters
- values: StoresValues<S>
Returns T
- reflect: ((reflecting: T, old: StoresValues<S>) => SetValues<S>)
Called when the derived store gets a new value via its
set
orupdate
methods, and determines new values for the origin stores. Read more... Optional
initial: TThe new store's initial value. Same as
derived
's 3rd parameter.
Returns Writable<T>
A writable store.
- writable
Derived <S, T>(origins, derive, reflect, initial?): Writable<T> Type Parameters
- S extends Stores
- T
Parameters
Returns Writable<T>
Create a store similar to Svelte's
derived
, but which has its ownset
andupdate
methods and can send values back to the origin stores. Read more...