Migration guide
Migrating from 2.0.0 to 3.0.0
- Reactive object definition
- Way of defining reactive state has changed from
state: () => ({ ... })toreactive: { ... }
- Executing actions
- Executing actions from machine instance no longer uses
.from()method. Instead actions are directly called from the state key like this:machine.INITIAL.increment(1)
- Action context has been changed
this.$statetothis.$reactivethis.changeStatetothis.$changeStatethis.resetStatetothis.$resetReactive
- Machine instance method has been changed
this.$statetothis.reactivethis.$changeStatetothis.changeStatethis.$resetStatetothis.resetReactive
- onEnter and onLeave hooks has been renamed
onEnterhook has been renamed to$onEnteronLeavehook has been renamed to$onLeave
- Initial state key is required while defining machine
- adding
initial: stringkey to machine is now required.