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);
How to Create a State Machine
Section titled “How to Create a State Machine”After first defining your states (i.e. by using defineStates
or matchboxFactory
), you can create a state machine using the createMachine
for a minimal factory machine, or matchina
for a machine wrapped with assignEventApi
, giving it a convenience API for firing events.
📦 Create Machines Create state machines with `createMachine` or `matchina`
🔧 Machine Enhancers Enhance your state machines with additional functionality
Related Topics
Section titled “Related Topics”- State Factory Machines - Create and configure complete state machines
- Lifecycle & Hooks - Detailed guide to the lifecycle system
- Effects - Managing side effects in state machines