Skip to content

Instantly share code, notes, and snippets.

@sebastiancarlsson
Last active September 23, 2021 12:18
Show Gist options
  • Save sebastiancarlsson/3a40ded13a3d05c33b0112a452998a23 to your computer and use it in GitHub Desktop.
Save sebastiancarlsson/3a40ded13a3d05c33b0112a452998a23 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const trafficLightMachine = Machine({
initial: 'green',
states: {
green: {
on: {
TICK_EVENT: 'yellow'
}
},
yellow: {
on: {
TICK_EVENT: 'red',
}
},
red: {
on: {
TICK_EVENT: 'green'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment