Created
June 20, 2020 17:01
-
-
Save wighawag/a79b7fc0dfb4d058c8d8d3fdf455ded9 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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