Skip to content

Instantly share code, notes, and snippets.

@brookslybrand
Last active January 17, 2020 15:53
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 brookslybrand/be1d37ad786a2845c18f2cbd3a1c2904 to your computer and use it in GitHub Desktop.
Save brookslybrand/be1d37ad786a2845c18f2cbd3a1c2904 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 feedbackMachine = Machine({
id: "feedbackMachine",
initial: "question",
on: {
CLOSE: "closed"
},
states: {
question: {
on: {
GOOD: "thanks",
BAD: "form",
CLOSE: "closed"
}
},
form: {
on: {
SUBMIT: "thanks",
CLOSE: "closed"
}
},
thanks: {
on: {
CLOSE: "closed"
}
},
closed: {
type: "final"
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment