Created
September 2, 2020 13:53
-
-
Save areai51/c9f1cd0d6ba1d3c9985d58d9f0776990 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
| const fileMachine = Machine({ | |
| id: 'file', | |
| type: 'parallel', | |
| states: { | |
| upload: { | |
| initial: 'idle', | |
| states: { | |
| idle: { | |
| on: { | |
| INIT_UPLOAD: 'pending' | |
| } | |
| }, | |
| pending: { | |
| on: { | |
| UPLOAD_COMPLETE: 'success' | |
| } | |
| }, | |
| success: {} | |
| } | |
| }, | |
| download: { | |
| initial: 'idle', | |
| states: { | |
| idle: { | |
| on: { | |
| INIT_DOWNLOAD: 'pending' | |
| } | |
| }, | |
| pending: { | |
| on: { | |
| DOWNLOAD_COMPLETE: 'success' | |
| } | |
| }, | |
| success: {} | |
| } | |
| } | |
| } | |
| }); | |
| console.log(fileMachine.initialState.value); | |
| // => { | |
| // upload: 'idle', | |
| // download: 'idle' | |
| // } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment