Skip to content

Instantly share code, notes, and snippets.

@dstockto
Last active July 9, 2020 03:53
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 dstockto/f168d4bb0fb67e6858c63f7259658e7c to your computer and use it in GitHub Desktop.
Save dstockto/f168d4bb0fb67e6858c63f7259658e7c 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: 'Traffic Light',
initial: 'red',
states: {
red: {
after: {
1000: {
target: "green"
}
}
},
green: {
after: {
2000: {
target: "yellow"
}
}
},
yellow: {
after: {
2000: {
target: "red"
}
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment