Skip to content

Instantly share code, notes, and snippets.

@ThaddeusJiang
Last active May 29, 2020 02:59
Show Gist options
  • Save ThaddeusJiang/de3e4d2adbb2eb0c063a548f1d740f00 to your computer and use it in GitHub Desktop.
Save ThaddeusJiang/de3e4d2adbb2eb0c063a548f1d740f00 to your computer and use it in GitHub Desktop.
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const lightMachine = Machine({
id: 'light',
initial: 'green',
states: {
green: {
on: {
timer: 'yello'
}
},
yello: {
on: {
timer: 'red',
}
},
red: {
on: {
timer: 'green'
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment