npm xstate 3.0.1

latest releases: 4.33.2, 4.33.1, 4.33.0...
4 years ago

This is the officially published v3 of xstate! 🎉

Some changes from V1 and V2:

  • machine.transition will always return a State object.
  • 🆕 onEntry, onExit actions for states, and actions for transition actions
  • 🆕 cond for conditional (guarded) transitions
  • 🆕 strict: true for strict mode (helpful in development)
  • Many more awesome things. For more information, read the docs.

If you're wondering why V3 and not V2:

  1. Versions are cheap.
  2. V2 was more of a sandbox version to test and dogfood new APIs. Those APIs have been solidified (thanks to help from the community) and have been released as V3, in case anyone (like myself) was using the undocumented V2 APIs.

Don't miss a new xstate release

NewReleases is sending notifications on new releases.