Skip to content

Instantly share code, notes, and snippets.

@Jpadilla1
Created December 11, 2019 17:31
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 Jpadilla1/bcd373824e7c0a516318eb8419fe9950 to your computer and use it in GitHub Desktop.
Save Jpadilla1/bcd373824e7c0a516318eb8419fe9950 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: "spark-status-machine",
initial: "loading",
states: {
loading: {
invoke: {
src: "sparkRequest",
onDone: "success",
onError: "failure"
}
},
success: {
entry: "notifySuccessToParent",
after: {
4000: "loading"
}
},
failure: {
entry: "notifyFailureToParent",
after: {
4000: "loading"
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment