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

Add transitions after calling constructor #142

Open
inakie opened this issue Nov 6, 2017 · 1 comment
Open

Add transitions after calling constructor #142

inakie opened this issue Nov 6, 2017 · 1 comment

Comments

@inakie
Copy link

inakie commented Nov 6, 2017

Is there a way to add new transitions/states after the first call to the constructor?

I have tried doing this

fsm._fsm.config.mapTransition({
  name: "startPause",
  from: "game",
  to: "pause"
});

but I get a fsm.startPause is not a function error.

Check out this codepen for my test
Thanks!

@rickbsgu
Copy link

rickbsgu commented Nov 9, 2017

Not sure why you would want to do this -- the whole idea of a 'finite state' machine is that there are a finite number of possible states. Adding states/transitions dynamically kinda breaks that paradigm...

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