Attempts to transition to a new state. Either a new MachineState is returned reflecting the change, or an exception is thrown.
MachineState
const newState = StateMachine.to(currentState, `name-of-state`); Copy
const newState = StateMachine.to(currentState, `name-of-state`);
Note that 'currentState' is not changed.
Attempts to transition to a new state. Either a new
MachineState
is returned reflecting the change, or an exception is thrown.