Skip to content

Instantly share code, notes, and snippets.

@rjdestigter
Created March 12, 2020 00:05
Show Gist options
  • Save rjdestigter/2453f8877b8cc744ac801f3dfdbdd535 to your computer and use it in GitHub Desktop.
Save rjdestigter/2453f8877b8cc744ac801f3dfdbdd535 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 machine = Machine({
id: "feedback",
initial: "question",
on: {
ESC: "closed",
},
states: {
question: {
on: {
CLICK_BAD: "form",
CLICK_GOOD: "thanks"
}
},
form: {
on: {
SUBMIT: 'submitting',
CLOSE: 'closed',
}
},
submitting: {
on: {
FAILED: 'failure',
SUCCEEDED: 'thanks',
CLOSE: 'closed',
}
},
failure: {
on: {
CLOSE: 'closed',
}
},
thanks: {
on: {
CLOSE: 'closed',
}
},
closed: {}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment