Skip to content

Instantly share code, notes, and snippets.

@calvinchengx
Created June 29, 2021 03:40
Show Gist options
  • Save calvinchengx/52634e82eab3fc311fc2156aea694883 to your computer and use it in GitHub Desktop.
Save calvinchengx/52634e82eab3fc311fc2156aea694883 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const feedbackMachine = Machine({
id: 'feedback',
initial: 'question',
states: {
question: {
on: {
CLICK_GOOD: 'thanks',
CLICK_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