Skip to content

Instantly share code, notes, and snippets.

@tomByrer
Created October 19, 2020 11:07
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 tomByrer/3a79acb44ddbc534fbebcda95e494a2f to your computer and use it in GitHub Desktop.
Save tomByrer/3a79acb44ddbc534fbebcda95e494a2f to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const spinnerMachine = Machine({
id: 'spinner',
initial: 'powerStripOff',
states: {
powerStripOff: {
on: {
SWITCH_ON: 'powerStripOn',
},
},
powerStripOn: {
on: {
SWITCH_OFF: 'powerStripOff',
FOOT_DOWN: 'running',
},
},
stopped: {
on: {
SWITCH_OFF: 'powerStripOff',
FOOT_DOWN: 'running',
},
},
running: {
on: {
SWITCH_OFF: 'powerStripOff',
FOOT_UP: 'stopped',
},
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment