State Machine Interface
What is a state machine?
Section titled “What is a state machine?”A minimal (pure) state machine in Matchina looks like this:
const { getState, send } = createMachine( states, transitions, initialState);
State Machines in Matchina
Section titled “State Machines in Matchina”In Matchina, you first define your states using defineStates()
, then use those states with createMachine()
or matchina()
to create a state machine. From there you can enhance and customize behavior using machine enhancers.
🏷️ Define States Define states with type-safe data using `defineStates`
⚙️ Create Machines Create state machines with `createMachine` or `matchina`
🔄 State Lifecycle Understand the state machine transition lifecycle
🪝 Lifecycle & Hooks Use lifecycle hooks to run code at key points in the state machine lifecycle
✨ Machine Enhancers Enhance your state machines with additional functionality