Changelog
8.0.1
Reconnecting to the machine when the component is re-mounted. Issue #38, PR: #39.
Changelog
6.0.0
Action handlers are pure functions now, i.e. they receive the machine as first argument and do not rely on this
context.
Custom machine functions are no longer supported.
Example for a handler before 6.x:
'add todo': function (state, todo) {
return {
name: 'idle',
todos: [...state.todos, todo]
};
}
Example for a handler function in 6.x:
'add todo': function ({state}, todo) {
return {
name: 'idle',
todos: [...state.todos, todo]
};
}
Example for an arrow function as handler in 6.x:
'add todo': ({state}, todo) => ({
name: 'idle',
todos: [...state.todos, todo]
})