Last active
November 12, 2019 16:21
-
-
Save isaacplmann/1f28d0da936b191d456e19c0b1721ddd to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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