jakesgordon / javascript-state-machine

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

Composible State Machine Approach #144

Open rickbsgu opened 6 years ago

rickbsgu commented 6 years ago

This is a follow-on to #47.

I have a demo that composes state machines outside of the package. It is here:

https://github.com/Aphorica/atmplus

docs are here:

https://aphorica.github.io/atmplus

In short, the demo implements an 'FSM_Manager' class that manages a stack of fsms, that are popped and pushed in the correct transitions (you need to derive the class to manage the transitions - 'ATM_FSM_Manager', in this instance.)

It seems to work ok for that application. Might serve as an example of what is possible.