Last active
August 5, 2021 13:49
-
-
Save easilyBaffled/23849650df96699ea7d0646f256440a0 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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 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