Skip to content

Instantly share code, notes, and snippets.

@ducin
Last active May 26, 2021 22:43
Show Gist options
  • Save ducin/d0dbaec7069c1e79114f97f93eaea2af to your computer and use it in GitHub Desktop.
Save ducin/d0dbaec7069c1e79114f97f93eaea2af to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'AuthorizeDevice',
initial: 'chooseMethod',
states: {
chooseMethod: {
on: {
CHOOSE_ADD_DEVICE: 'addDeviceForm',
}
},
addDeviceForm: {
on: {
SUBMIT_DEVICE_NAME: "addDeviceToken"
}
},
addDeviceToken: {
on: {
CANCEL_CHOICE: 'chooseMethod',
RESET_TOKEN: "addDeviceToken",
SUBMIT: "addDeviceConfirmation"
}
},
addDeviceConfirmation: {
on: {
CONFIRM_DEVICE_ADDED: "addDeviceSuccess"
}
},
addDeviceSuccess: {
type: 'final',
},
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment