Last active
June 22, 2020 22:20
-
-
Save wighawag/a00a551a6ea10ba630fdf22f474a32c6 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', | |
on :{ | |
PROBE: { | |
target: '.probing', | |
in: 'unknown', | |
}, | |
RETRY: { | |
target: '.probing', | |
in: 'probing.error', | |
}, | |
CANCEL: { | |
target: '.unknown', | |
in: 'probing', | |
}, | |
}, | |
states: { | |
unknown: {}, | |
probing: { | |
entry: 'probe', | |
initial: 'start', | |
states: { | |
start: { | |
on: { | |
FOUND: '#found', | |
NOT_FOUND: '#notFound', | |
ERROR: 'error', | |
}, | |
}, | |
error: {}, | |
} | |
}, | |
found: { | |
id: 'found', | |
type: 'final', | |
}, | |
notFound: { | |
id: '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