Last active
June 14, 2020 20:22
-
-
Save nickbreaton/0ecb7e632d56357376c69d4ae6602119 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) | |
| function delay(timeout) { | |
| return new Promise(res => { | |
| setTimeout(res, timeout) | |
| }) | |
| } | |
| function writeEntrypoint() { | |
| } | |
| const devCommandrMachine = Machine({ | |
| id: 'dev-command', | |
| initial: 'setup', | |
| states: { | |
| setup: { | |
| invoke: { | |
| src: () => delay(20), | |
| onDone: 'ready', | |
| } | |
| }, | |
| ready: { | |
| type: 'parallel', | |
| states: { | |
| clientBuild: { | |
| initial: 'building', | |
| states: { | |
| building: {}, | |
| } | |
| }, | |
| serverBuild: { | |
| initial: 'building', | |
| states: { | |
| building: {} | |
| } | |
| }, | |
| devServer: { | |
| initial: 'pendingRequest', | |
| states: { | |
| pendingRequest: {} | |
| } | |
| } | |
| } | |
| } | |
| // pendingRequest: { | |
| // on: { | |
| // REQUEST: { | |
| // target: 'writingEntryPoint', | |
| // actions: assign({ url: (_, event) => event.url }) | |
| // } | |
| // } | |
| // }, | |
| // writingEntryPoint: { | |
| // invoke: { | |
| // id: 'write entrypoint' | |
| // } | |
| // } | |
| } | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment