Skip to content

Instantly share code, notes, and snippets.

@datdoan
Created September 21, 2021 02:54
Show Gist options
  • Save datdoan/1e8ce1d3adb9874233ac3b81bd635a62 to your computer and use it in GitHub Desktop.
Save datdoan/1e8ce1d3adb9874233ac3b81bd635a62 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 rotationMachine = Machine({
id: 'rotate',
initial: 'autoplay',
states: {
autoplay: {
on: {
TRUE: 'play',
FALSE: 'pause',
},
},
play: {
on: {
IS_STOPPED: 'pause',
HAS_HOVER: 'pause',
HAS_FOCUS: 'pause',
},
},
pause: {
on: {
IS_NOT_STOPPED: 'play',
HAS_NOT_NOT_HOVER: 'play',
HAS_NOT_FOCUS: 'play',
},
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment