jakesgordon / javascript-state-machine

A javascript finite state machine library
MIT License
8.69k stars 964 forks source link

Discussion before pull request: wildcard transition, and args to error handling methods #122

Open adami opened 7 years ago

adami commented 7 years ago

Would like to suggest 2 changes:

  1. wildcard transition - meant to 'catch' all unexpected transitions of a specific (or all, if using *) 'from' state - can be solved in onInvalidTransition, i guess, but seems cleaner

  2. passing the args sent with the transition when calling onInvalidTransition/onPendingTransition (other error catchers too?) - i need it because i'm passing args that let me output a message to a specific place, and because why not?

Would love to hear your thoughts on these