Skip to content

Instantly share code, notes, and snippets.

@Addono
Last active July 15, 2020 08:31
Show Gist options
  • Save Addono/2cccde93b8c36974fc5ebe6e4c147595 to your computer and use it in GitHub Desktop.
Save Addono/2cccde93b8c36974fc5ebe6e4c147595 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'verifiedLocation',
initial: 'registeringListener',
states: {
registeringListener: {
on: { LISTENING: 'listening' },
},
listening: {
on: { READY: 'ready' },
},
ready: {
on: { SUBMIT: 'submitting' },
},
submitting: {
on: {
GRANTED: 'success',
REVOKED: 'revoked',
FAILED: 'failed'
},
entry: 'submit',
},
success: {
on: { SUBMIT: 'submitting' },
},
revoked: {
on: { SUBMIT: 'submitting' },
},
failed: {
on: { SUBMIT: 'submitting' },
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment