Skip to content

Store

Defined in: store/types.ts:6

Generic interface that any state management library must implement

Type ParameterDefault type
TStateany

dispatch(action): void

Defined in: store/types.ts:21

Dispatch an action to update state

ParameterType
actionAction

void


getState(): TState

Defined in: store/types.ts:10

Get the current state

TState


subscribe(listener): () => void

Defined in: store/types.ts:16

Subscribe to state changes Returns an unsubscribe function

ParameterType
listener(state) => void

() => void