npm xstate 4.2.1

latest releases: 4.33.0, 5.0.0-alpha.0, 4.32.1...
3 years ago
  • 📚 Lots of documentation updates:
  • 💥 Added the .event property to State instances, so you can know which event caused the transition to the current State:
const lightMachine = Machine({ /* ... */ });

const currentState = lightMachine.transition('green', 'TIMER');

// => { type: 'TIMER' }
  • 👪 Fixed #269 by ensuring two things:
    • Services invoked on the parent machine (which are alive for the lifetime of the machine, FYI) are successfully invoked when the machine is started
    • Starting activities (such as invoke, which is an activity) should be executed before executing onEntry actions.

Don't miss a new xstate release

NewReleases is sending notifications on new releases.