- StateMachine
#constructor
- should allow setting
initialState
- should allow registering State's
- should allow registering Transition's, and a fallback Transition
- should allow setting
#switchState
- should allow switch between available State's
- should perform a transition before calling
#onEnter
on new state - should return a promise, done or fail
- should emit an event, done or fail
- [eventHub]
- State
#name
#can
- should be called before entering state
- should be passed the current state's name
- should return a promise
#onEnter
- should be called on entering state
- should be passed the previous state's name
- should return a promise
#onExit
- should be called on exiting state
- should be passed the next state's name
- should return a promise
#rollBack
- should allow undoing exit procedure, in case transition failed
- should be passed the next state's name
- should return a promise
- Transition
#perform
- should be passed the source and destination state names
- should return a promise
Created
February 4, 2015 19:35
-
-
Save hlfcoding/f5b4ae1f4c2256eaeb42 to your computer and use it in GitHub Desktop.
StateMachine
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment