Skip to content

Instantly share code, notes, and snippets.

@edgerunner
Created May 5, 2020 13:00
Show Gist options
  • Save edgerunner/16c187a456c5cfc49002df8557815df3 to your computer and use it in GitHub Desktop.
Save edgerunner/16c187a456c5cfc49002df8557815df3 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchMachine = Machine({ "id": "root", "states": { "Cow": { "id": "Cow", "states": { "Untracked": { "id": "Untracked", "states": {}, "on": { "first-session-started": "#Pending" } }, "Pending": { "id": "Pending", "states": {}, "on": { "session-activated": "#Tracked" } }, "Tracked": { "id": "Tracked", "states": { "Pregnancy": { "id": "Pregnancy", "states": { "Not Pregnant": { "id": "Not Pregnant", "states": {}, "on": { "pregnancy-detected": "#Pregnant" } }, "Pregnant": { "id": "Pregnant", "states": { "Gestating": { "id": "Gestating", "states": {}, "on": { "calving-due": "#Due" } }, "Due": { "id": "Due", "states": { "Unconfirmed": { "id": "Unconfirmed", "states": {}, "on": { "calving-due-canceled": "#Gestating", "calving-due-confirmed": "#Confirmed" } }, "Confirmed": { "id": "Confirmed", "states": {} } }, "initial": "Unconfirmed", "on": { "calving-due-false": "#Gestating" } }, "Calving": { "id": "Calving", "states": {}, "on": { "calving-complete": "#Post-partum", "calving-false": "#Due" } } }, "initial": "Gestating", "on": { "calving-detected": "#Calving" } }, "Post-partum": { "id": "Post-partum", "states": {}, "on": { "post-partum-over": "#Not Pregnant" } } }, "initial": "Not Pregnant", "on": {} }, "Temperature": { "id": "Temperature", "states": { "Normal": { "id": "Normal", "states": {}, "on": { "fever-detected": "#Fever", "hypothermia-detected": "#Hypothermia" } }, "Fever": { "id": "Fever", "states": {}, "on": { "fever-over": "#Normal" } }, "Hypothermia": { "id": "Hypothermia", "states": {}, "on": { "hypothermia-over": "#Normal" } } }, "initial": "Normal", "on": {} } }, "parallel": true, "on": {} } }, "initial": "Untracked", "on": {} } }, "initial": "Cow", "on": {}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment