Skip to main content

FSM

A simple type-safe finite state machine. This is used internally to control the Order process, ensuring that the state of Orders, Payments, Fulfillments and Refunds follows a well-defined behaviour.

Signature

constructor

method(config: StateMachineConfig<T, Data>, initialState: T) => FSM

initialState

propertyT

currentState

propertyT

transitionTo

method(state: T, data: Data) => Promise<{ finalize: () => Promise<any> }>

jumpTo

method(state: T) =>

getNextStates

method() => readonly T[]

canTransitionTo

method(state: T) => boolean
Was this chapter helpful?
Report Issue
Edited Feb 25, 2026ยทEdit this page