Skip to content

State Machine Interface

A minimal (pure) state machine in Matchina looks like this:

const { getState, send } = createMachine(states, transitions, initialState);

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.