@hyperfrontend/state-machine/state

state

Initial-state factory for constructing a fresh state-machine state object.

createInitialState() returns the canonical empty state shape that the Store expects on construction. Use it when wiring up a store directly, when seeding tests, or when resetting a long-lived store back to a known-good initial value.

API Reference

ƒ Functions

§function

createInitialState(): State

Creates the initial state for the state machine.

Returns

State
Initial state with all flags set to false

Example

Creating initial state

const state = createInitialState()
// => { inProgress: false, success: false, fail: false, halt: false }