Skip to content

Instantly share code, notes, and snippets.

@isaacplmann
Last active November 12, 2019 16:21
Show Gist options
  • Save isaacplmann/1f28d0da936b191d456e19c0b1721ddd to your computer and use it in GitHub Desktop.
Save isaacplmann/1f28d0da936b191d456e19c0b1721ddd 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 myMachine = Machine({
id: 'slide',
initial: 'ground',
states: {
ground: {
on: {
CLIMB_UP: 'ladder'
}
},
ladder: {
},
topOfSlide: {
on: {
CLIMB_DOWN: 'ladder',
SLIDE: 'ground'
}
},
}
})
// Make ladder a parallel state
// Give it subStates for leftLeg and rightLeg
// LIFT_LEFT_LEG and LIFT_RIGHT_LEG should move leftLeg and rightLeg from down to up states
// When both leftLeg and rightLeg are `up`, you should transition to topOfSlide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment