npm xstate 4.2.1

latest releases: 5.12.0, 5.11.0, 5.10.0...
5 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.