Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

v0.2.0

Choose a tag to compare

@nickuraltsev nickuraltsev released this 20 Feb 01:30
· 134 commits to master since this release

Added support for event payloads.

const stateMachine = StateMachine
  .configure()
    .initialState('state1')
      .on('eventA').transitionTo('state2').withAction((fromState, toState, context) => {
        // Do something with the payload
        console.log('Payload:', context.eventPayload);
      })
  .start();

// Send an event with a payload
stateMachine.handle('eventA', { foo: 'bar' });