Skip to content

Instantly share code, notes, and snippets.

@johnnydecimal
Created March 23, 2020 09:35
Show Gist options
  • Save johnnydecimal/86e70ac75b1ad36a9ac4a4b5a34bbd42 to your computer and use it in GitHub Desktop.
Save johnnydecimal/86e70ac75b1ad36a9ac4a4b5a34bbd42 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Linked to play.jd.com.
// Do not delete or edit.
const jdLanguage = Machine({
id: 'jdLanguage',
initial: 'start',
states: {
start: {
on: {
FIND_AREA: 'area_detected',
FIND_EOF: 'eof',
FIND_OTHER: 'error',
},
},
'area_detected': {
on: {
FIND_AREA: 'area_detected',
FIND_CATEGORY: 'category_detected',
FIND_EOF: 'eof',
FIND_OTHER: 'error',
},
},
'category_detected': {
on: {
FIND_AREA: 'area_detected',
FIND_CATEGORY: 'category_detected',
FIND_ID: 'id_detected',
FIND_EOF: 'eof',
FIND_OTHER: 'error',
},
},
'id_detected': {
on: {
FIND_AREA: 'area_detected',
FIND_CATEGORY: 'category_detected',
FIND_ID: 'id_detected',
FIND_EOF: 'eof',
FIND_OTHER: 'error',
},
},
eof: {},
error: {},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment