Last active
May 26, 2021 13:41
-
-
Save leeh/77f4e238b2d8a16c036158054e290536 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions | |
| // - XState (all XState exports) | |
| const fetchMachine = Machine({ | |
| id: 'Simulcast', | |
| initial: 'new', | |
| context: { | |
| elapsed: 0 | |
| }, | |
| states: { | |
| new: { | |
| on: { | |
| SAVE: { target: 'pending' }, | |
| }, | |
| }, | |
| pending: { | |
| on: { | |
| ACTIVATE: { target: 'inuse' }, | |
| }, | |
| initial: 'scheduling', | |
| states: { | |
| scheduling: { | |
| on: { | |
| SCHEDULE: { target: 'scheduled' }, | |
| }, | |
| }, | |
| scheduled: { | |
| on: { | |
| EXPIRE: { target: 'expired' }, | |
| }, | |
| }, | |
| expired: { | |
| type: 'final', | |
| }, | |
| }, | |
| }, | |
| inuse: { | |
| initial: 'activating', | |
| states: { | |
| activating: { | |
| on: { | |
| ACTIVATED: { target: 'active' }, | |
| }, | |
| }, | |
| active: { | |
| on: { | |
| START: { target: 'starting' }, | |
| }, | |
| }, | |
| starting: { | |
| on: { | |
| START_COMPLETE: { target: 'live' }, | |
| }, | |
| }, | |
| live: { | |
| on: { | |
| STOP: { target: 'stopping' }, | |
| }, | |
| }, | |
| stopping: { | |
| on: { | |
| STOP_COMPLETE: { target: 'completed' }, | |
| }, | |
| }, | |
| completed: { | |
| type: 'final', | |
| }, | |
| } | |
| }, | |
| error: {}, | |
| } | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment