Created
August 7, 2019 22:13
-
-
Save neonphog/87b054dd51d85a28ec417bf00da631cd 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: 'network', | |
| type: 'parallel', | |
| on: { | |
| BIND: { | |
| target: [ | |
| '.core.bind.waitBind', | |
| '.p2p.bind.waiting' | |
| ] | |
| } | |
| }, | |
| states: { | |
| core: { | |
| type: 'parallel', | |
| states: { | |
| bind: { | |
| initial: 'done', | |
| states: { | |
| waitBind: {}, | |
| waitConnected: { | |
| id: 'core.waitConnected', | |
| on: { RESP: 'done' } | |
| }, | |
| done: { type: 'final' } | |
| } | |
| } | |
| } | |
| }, | |
| p2p: { | |
| type: 'parallel', | |
| states: { | |
| bind: { | |
| initial: 'done', | |
| states: { | |
| waiting: { | |
| id: 'p2p.waiting', | |
| on: { BOUND: 'done' } | |
| }, | |
| done: { | |
| type: 'final', | |
| on: { | |
| null: '#core.waitConnected' | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment