Skip to content

Instantly share code, notes, and snippets.

@drenther
Last active January 6, 2021 16:58
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 drenther/4bab7200a927cdfc989d754aa1456644 to your computer and use it in GitHub Desktop.
Save drenther/4bab7200a927cdfc989d754aa1456644 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 ballMachine = Machine({
id: 'ball_sort',
initial: 'idle',
states: {
idle: {
on: { lift_ball: 'lifting' }
},
lifting: {
on: { lifting_complete: 'lifted' }
},
lifted: {
on: {
move: 'moving',
drop: 'dropping'
}
},
moving: {
on: {
move_complete: 'dropping',
}
},
dropping: {
on: {
drop_complete: 'idle'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment