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: https://xstate.js.org/docs
  • 💥 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');

console.log(currentState.event);
// => { 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.