If startStateMachine() is erroneously called twice, "all" events of the element are bound twice so every event triggered run the onMachineEvent callback twice.
It is very easy to make this mistake when you use the StatefulView version : you do not have to call startStateMachine() yourself in this case because it already has been called.
You should either make it safe to execute this code twice (by checking if it has already be initialized), or make it clear in the docs that startStateMachine() should not be called when using the StatefulView.
If
startStateMachine()
is erroneously called twice, "all" events of the element are bound twice so every event triggered run theonMachineEvent
callback twice.It is very easy to make this mistake when you use the StatefulView version : you do not have to call
startStateMachine()
yourself in this case because it already has been called.You should either make it safe to execute this code twice (by checking if it has already be initialized), or make it clear in the docs that
startStateMachine()
should not be called when using the StatefulView.