Skip to content

Instantly share code, notes, and snippets.

@maddyonline
Created November 12, 2019 03:04
Show Gist options
  • Save maddyonline/9863fa4be43ab310a93b84aacdd84fe7 to your computer and use it in GitHub Desktop.
Save maddyonline/9863fa4be43ab310a93b84aacdd84fe7 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 xMachine = Machine({
id: 'exercise',
initial: 'idle',
context: {
id: '123',
gif: 'example.gif',
duration: '30'
},
states: {
idle: {
on: {
BEGIN: 'loop'
}
},
loop: {
on: {
PAUSE: 'paused',
FINISH: 'rest',
DONE: 'rest',
NEXT: 'rest'
}
},
paused: {
on: {
RESUME: 'loop',
FINISH: 'rest'
}
},
rest: {
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment