I started using fsm.cannot(transition) to see if my fsm can handle the incoming transition before applying it.
It looks like using it for wildcard transitions that accept args (e.g. the famous "goto") returns the wrong result.
If I understand correctly, it's because these methods use the seek() method that tries to use the args to see which state the wildcard is sending the fsm to, but can() and cannot() are not passing it.
As a workaround i use fsm.transitions().includes(transition) that i think does what fsm.can() is supposed to do.
I started using fsm.cannot(transition) to see if my fsm can handle the incoming transition before applying it.
It looks like using it for wildcard transitions that accept args (e.g. the famous "goto") returns the wrong result. If I understand correctly, it's because these methods use the seek() method that tries to use the args to see which state the wildcard is sending the fsm to, but can() and cannot() are not passing it.
As a workaround i use fsm.transitions().includes(transition) that i think does what fsm.can() is supposed to do.