Skip to content

How to let the on() callback be called for the startState? #25

Description

@bbjay

On startup of my program, I need to be able to sync my state machine to an external/remote machine with the same states. Looking at the code, creating a new instance with the same startState seems to be the obvious way to do this.
The problem now is that I also need the on() callback be called for that startState, which of course is not possible at the construction time of the FSM as the transitions are defined only after instantiation.

The reset() method unfortunately does not call the callbacks. Calling .go(startState) is only possible with allowImplicitSelfTransition=true, which is not an option for my case.

Am I missing something, or is this not possible at the moment?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions