Skip to content

Instantly share code, notes, and snippets.

@schpet
Created December 14, 2020 06:08
Show Gist options
  • Save schpet/c8e17af3ee0f0aab2599b3516b42fdcd to your computer and use it in GitHub Desktop.
Save schpet/c8e17af3ee0f0aab2599b3516b42fdcd 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 houseMachine = Machine({
id: 'house',
initial: 'house',
states: {
house: {
on: {
LEAVE_HOUSE: "barn",
STAY_INSIDE: "crashingUpstairs"
}
},
crashingUpstairs: {
entry: "talkingOnCb",
on: {
SURVIVE: "nextChapter",
DIE: "end",
RUN: "barn"
}
},
barn: {
on: {
SURVIVE: "nextChapter",
DIE: "end"
}
},
nextChapter: {
type: "final"
},
end: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment