O3 Framework / subscribeTo
subscribeTo<
T,U>(store,handle): () =>void
Defined in: packages/framework/esm-state/src/state.ts:137
Subscribes to a store and invokes a callback when the state changes. The callback is also immediately invoked with the current state upon subscription. Uses shallow equality comparison to determine if the state has changed.
This function has two overloads:
T
U = T
StoreApi<T>
The store to subscribe to.
(state) => void
A callback function that receives the state (or selected state) when it changes.
An unsubscribe function to stop listening for changes.
():
void
void
subscribeTo<
T,U>(store,select,handle): () =>void
Defined in: packages/framework/esm-state/src/state.ts:138
Subscribes to a store and invokes a callback when the state changes. The callback is also immediately invoked with the current state upon subscription. Uses shallow equality comparison to determine if the state has changed.
This function has two overloads:
T
U
StoreApi<T>
The store to subscribe to.
(state) => U
(subState) => void
A callback function that receives the state (or selected state) when it changes.
An unsubscribe function to stop listening for changes.
():
void
void