Skip to content

Instantly share code, notes, and snippets.

@easilyBaffled
Last active August 5, 2021 13:49
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 easilyBaffled/23849650df96699ea7d0646f256440a0 to your computer and use it in GitHub Desktop.
Save easilyBaffled/23849650df96699ea7d0646f256440a0 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: "fetch",
initial: "idle",
context: {
retries: 0,
},
states: {
idle: {
on: {
commit: "pre-commit hook",
},
},
"pre-commit hook": {
on: {
"validate code ❌": "idle",
"validate code ✅": "prepare-commit-msg",
},
},
"prepare-commit-msg": {
on: {
"pre-populate commit message": "enter commit message",
},
},
"enter commit message": {
on: {
"validate commit message ❌": "idle",
"validate commit message ✅": "commit code",
},
},
"commit code": {
on: {
"post-commit": "idle",
},
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment