Skip to content

Instantly share code, notes, and snippets.

@llldc21
Created January 17, 2020 20:09
Show Gist options
  • Save llldc21/253e7997d432fb5ae0e248dff4c111bd to your computer and use it in GitHub Desktop.
Save llldc21/253e7997d432fb5ae0e248dff4c111bd to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'fetch',
initial: 'draft',
context: {
state: 'draft'
},
states: {
draft: {
onEntry: ['test'],
after: {
run: [
{ target: 'ok' },
{ target: 'fail' }
]
}
},
ok: {
type: 'final'
},
fail: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment