Skip to content

CreateStoreConfig

Type Alias: CreateStoreConfig<TState, TActions>

Section titled “Type Alias: CreateStoreConfig<TState, TActions>”

CreateStoreConfig<TState, TActions> = object

Defined in: types.ts:90

Configuration object for createStore.

TState extends object

TActions extends object

optional actions?: ActionsCreator<TState, TActions>

Defined in: types.ts:99

Action creator. Receives set and get from Zustand.


optional devtools?: boolean

Defined in: types.ts:103

Enable Redux DevTools integration. Defaults to true in development.


initial: TState

Defined in: types.ts:97

Initial state. Shallow-frozen at runtime in development to catch top-level mutations — nested mutations are NOT detected.


name: string

Defined in: types.ts:92

Unique store name. Used as storage key and devtools label.


optional onError?: (error, info) => void

Defined in: types.ts:110

Diagnostic hook fired when hydration parsing, persistence writes, migrations, or reset cleanup fail. Failures are still swallowed (losing persistence is preferable to crashing) — this hook is purely for observability.

unknown

StoreErrorInfo

void


optional persist?: PersistConfig<TState>

Defined in: types.ts:101

Persistence configuration. Omit to disable persistence.