Skip to content
masterclass Buddy

Zustand · Type Alias

StoreApi.getInitialState

StoreApi.getInitialState returns the state captured when a Zustand store is created. Use it with set to restore the store, commonly through a reset action.

Last updated

Syntax

createStore<T>()((set, get, store) => ({ ... }))

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • createStore
  • create
  • StoreApi.getInitialState
  • setState
  • getState
  • subscribe

Source: How to reset state - Zustand Docs. Checked 2026-11-03.