Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is there onEnter* fired on state machine initialization? #192

Open
nemanjan00 opened this issue Jan 2, 2020 · 2 comments
Open

Why is there onEnter* fired on state machine initialization? #192

nemanjan00 opened this issue Jan 2, 2020 · 2 comments

Comments

@nemanjan00
Copy link

nemanjan00 commented Jan 2, 2020

Can that be disabled?

If I am setting existing state, machine is already in, why is there event fired?

Can that behaviour be disabled?

I can see I got there from "none", but, I do not want to have if(lifecycle.from == "none) return; in each event handler...

@Sebring
Copy link

Sebring commented Jan 8, 2021

When the machine is loaded it will do a 'init'-transition and enter the state defined as 'init' in the constructor. Maybe what you are looking for is the goto to set a state without transition?

@nemanjan00
Copy link
Author

The way I use it, it is persistant state machine. I do save it to DB after each change, and load it from DB, every time I want to apply transition, so it is not great to have to check if it is init transition, on every state change and if it is, ignore it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants