Skip to content

SimpleStore

Defined in: store/adapters/SimpleAdapter.ts:12

Simple store implementation using just plain JavaScript objects. No external dependencies required. Sync action handling delegates to applyAction — the shared pure reducer.

Type ParameterDefault type
TStateany

new SimpleStore<TState>(initialState): SimpleStore<TState>

Defined in: store/adapters/SimpleAdapter.ts:18

ParameterType
initialStateTState

SimpleStore<TState>

dispatch(action): void

Defined in: store/adapters/SimpleAdapter.ts:47

Dispatch an action to update state

ParameterType
actionAction

void

Store.dispatch


getState(): TState

Defined in: store/adapters/SimpleAdapter.ts:36

Get the current state

TState

Store.getState


subscribe(listener): () => void

Defined in: store/adapters/SimpleAdapter.ts:40

Subscribe to state changes Returns an unsubscribe function

ParameterType
listener(state) => void

() => void

Store.subscribe