JotaiAdapter
Defined in: index.ts:34
The Store that createJotaiStore and createJotaiStoreSync return: app state in one root atom.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TState | any |
Implements
Section titled “Implements”Store<TState>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new JotaiAdapter<
TState>(initialState,options?):JotaiAdapter<TState>
Defined in: index.ts:41
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
initialState | TState |
options? | JotaiAdapterOptions |
Returns
Section titled “Returns”JotaiAdapter<TState>
Methods
Section titled “Methods”dispatch()
Section titled “dispatch()”dispatch(
action):void
Defined in: index.ts:73
Dispatch an action to update state
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
action | Action |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Store.dispatch
getState()
Section titled “getState()”getState():
TState
Defined in: index.ts:54
Get the current state
Returns
Section titled “Returns”TState
Implementation of
Section titled “Implementation of”Store.getState
subscribe()
Section titled “subscribe()”subscribe(
listener): () =>void
Defined in: index.ts:58
Subscribe to state changes Returns an unsubscribe function
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
listener | (state) => void |
Returns
Section titled “Returns”() => void
Implementation of
Section titled “Implementation of”Store.subscribe