Last active
April 12, 2021 06:06
-
-
Save reedspool/db9e05eba8606ed807b785707e5d75f3 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const fetchMachine =Machine({ | |
id: "cat", | |
initial: "kitten", | |
strict: true, | |
on : { | |
talk: { actions: [ () => console.log("meeeoooowww") ] } | |
}, | |
states: { | |
kitten: { | |
on: { | |
talk: { | |
target: "kittenforever", | |
actions: [ () => console.log("mew mew mew") ] | |
} | |
} | |
}, | |
kittenforever : { | |
on: { | |
talk: { | |
actions: [ function () { throw new Error("I don't want to talk") }] | |
} | |
} | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment