Skip to content

Instantly share code, notes, and snippets.

@karlguillotte
Created June 17, 2021 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karlguillotte/5937fe4564a3bdb8eb993a06d2482371 to your computer and use it in GitHub Desktop.
Save karlguillotte/5937fe4564a3bdb8eb993a06d2482371 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
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: {}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment