Skip to content

Instantly share code, notes, and snippets.

@stlachman
Last active October 1, 2019 14:58
Show Gist options
  • Save stlachman/13d7d49ff4f5c5cf1a12db093e458aac to your computer and use it in GitHub Desktop.
Save stlachman/13d7d49ff4f5c5cf1a12db093e458aac 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 elevatorMachine = Machine({
key: "door",
initial: "closed",
states: {
closed: {
on: {
OPEN: "open",
LOCK: "locked"
}
},
open: {
on: {
CLOSE: "closed"
}
},
locked: {
on: {
UNLOCK: "closed"
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment