javascript-state-machine icon indicating copy to clipboard operation
javascript-state-machine copied to clipboard

.can(transition) doesn't work as expected.

Open elsid139 opened this issue 3 years ago • 0 comments

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)) {

elsid139 avatar Dec 07 '22 11:12 elsid139