diff --git a/ROADMAP.md b/ROADMAP.md index d6729d9..45b343f 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -5,23 +5,27 @@ - [x] Event payloads - [x] Time triggers - [x] Promise triggers -- [ ] Hierarchical state machines +- [ ] Hierarchical state machines *(in progress)* - [ ] Ignoring events - [ ] Persistence support ### Hierarchical state machines ```javascript -.state('state1') - .on('eventA').transitionTo('state2') - .submachine() - .rememberLastState() - .initialState('substate1') - .on('eventB').transitionTo('substate2') - .state('substate2') - .on('eventC').transitionTo('substate3') - .parent() -.state('state2') +const submachineConfig = Finity + .configure() + .initialState('substate2A') + .on('event2').transitionTo('substate2B') + .getConfig(); + +const stateMachine = Finity + .configure() + .initialState('state1') + .on('event1').transitionTo('state2') + .state('state2') + .on('event3').transitionTo('state3') + .submachine(submachineConfig) + .start(); ``` ### Ignoring events @@ -39,7 +43,7 @@ TBD... - [x] Global hooks - [x] Clarify how guard conditions work - [x] Entry, exit, and transition action parameters -- [ ] Project website +- [ ] Project website *(in progress)* - [ ] Clarify that final states don't need to be explicitly defined - [ ] Execution order of entry, exit, and transition actions and global hooks - [ ] Recursive events & event queue