Skip to content

Instantly share code, notes, and snippets.

@wighawag
Created June 20, 2020 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wighawag/a79b7fc0dfb4d058c8d8d3fdf455ded9 to your computer and use it in GitHub Desktop.
Save wighawag/a79b7fc0dfb4d058c8d8d3fdf455ded9 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'planet',
initial: 'unknown',
states: {
unknown: {
on: {
PROBE: 'probing',
},
},
probing: {
entry: 'probe',
initial: 'start',
on:{
CANCEL: 'unknown',
FOUND: {
target:'found',
},
NOT_FOUND: 'notFound',
},
states: {
start: {
on: {
// NOT_FOUND: 'probed',
ERROR: 'error',
},
},
error: {
on: {
RETRY: 'start',
},
},
}
},
found: {
type: 'final',
},
notFound: {
type: 'final',
},
}
},
{
actions: {
probe: () => {
console.log('probe');
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment