F
useStore
Selects state from Flux stores in a component, re-rendering only when the selection changes.
function useStore<S extends FluxStore | readonly FluxStore[], T>(stores: S, selector: (stores: S) => T, options?: UseStoreOptions<T>): TParameters
| Name | Type | Description |
|---|---|---|
| stores | S | The store, or stores, the selector reads. |
| selector | (stores: S) => T | Reads the value from the stores, which it receives as passed. |
| options? | UseStoreOptions<T> | The selector's |
Returns
TThe selector's latest value.