javascript-state-machine
javascript-state-machine copied to clipboard
.can(transition) doesn't work as expected.
An element of transitions: [] is as below: {name: 'deleteRec', from: ['idle', 'deleting', 'renaming'], to: function(s) {return s; }}, I call the transition in the state of 'idle' as below, but the condition always returns false! if (fsm.can('deleteRec')) {
So I have to use if (['idle', 'deleting', 'renaming'].includes(fsm.state)) {