Store
Defined in: store/types.ts:6
Generic interface that any state management library must implement
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TState | any |
Methods
Section titled “Methods”dispatch()
Section titled “dispatch()”dispatch(
action):void
Defined in: store/types.ts:21
Dispatch an action to update state
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
action | Action |
Returns
Section titled “Returns”void
getState()
Section titled “getState()”getState():
TState
Defined in: store/types.ts:10
Get the current state
Returns
Section titled “Returns”TState
subscribe()
Section titled “subscribe()”subscribe(
listener): () =>void
Defined in: store/types.ts:16
Subscribe to state changes Returns an unsubscribe function
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
listener | (state) => void |
Returns
Section titled “Returns”() => void