Skip to content

JotaiAdapter

Defined in: index.ts:34

The Store that createJotaiStore and createJotaiStoreSync return: app state in one root atom.

Type ParameterDefault type
TStateany
  • Store<TState>

new JotaiAdapter<TState>(initialState, options?): JotaiAdapter<TState>

Defined in: index.ts:41

ParameterType
initialStateTState
options?JotaiAdapterOptions

JotaiAdapter<TState>

dispatch(action): void

Defined in: index.ts:73

Dispatch an action to update state

ParameterType
actionAction

void

Store.dispatch


getState(): TState

Defined in: index.ts:54

Get the current state

TState

Store.getState


subscribe(listener): () => void

Defined in: index.ts:58

Subscribe to state changes Returns an unsubscribe function

ParameterType
listener(state) => void

() => void

Store.subscribe