Skip to content

Instantly share code, notes, and snippets.

@tivac
Created May 7, 2020 20:45
Show Gist options
  • Save tivac/28eb3ffd83610584fbee549983f01459 to your computer and use it in GitHub Desktop.
Save tivac/28eb3ffd83610584fbee549983f01459 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: 'fetch',
initial: 'idle',
context: {
retries: 0
},
on : {
RAISED : ".raised",
SENT : ".sent",
},
states: {
idle: {
entry : [
send("SENT"),
raise("RAISED")
]
},
raised: {
entry : () => console.log("raised"),
},
sent: {
entry : () => console.log("sent"),
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment