Created
October 12, 2020 15:25
-
-
Save davidkpiano/529435f997b4276799778db37f64b0da to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or 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: 'donut', | |
initial: 'ingredients', | |
states: { | |
ingredients: { | |
on: { | |
NEXT: 'directions', | |
}, | |
}, | |
directions: { | |
initial: 'makeDough', | |
onDone: 'fry', | |
states: { | |
makeDough: { | |
on: { NEXT: 'mix' }, | |
}, | |
mix: { | |
type: 'parallel', | |
states: { | |
mixDry: { | |
initial: 'mixing', | |
states: { | |
mixing: { | |
on: { MIXED_DRY: 'mixed' }, | |
}, | |
mixed: { | |
type: 'final', | |
}, | |
}, | |
}, | |
mixWet: { | |
initial: 'mixing', | |
states: { | |
mixing: { | |
on: { MIXED_WET: 'mixed' }, | |
}, | |
mixed: { | |
type: 'final', | |
}, | |
}, | |
}, | |
}, | |
onDone: 'allMixed', | |
}, | |
allMixed: { | |
type: 'final', | |
}, | |
}, | |
}, | |
fry: { | |
on: { | |
NEXT: 'flip', | |
}, | |
}, | |
flip: { | |
on: { | |
NEXT: 'dry', | |
}, | |
}, | |
dry: { | |
on: { | |
NEXT: 'glaze', | |
}, | |
}, | |
glaze: { | |
on: { | |
NEXT: 'serve', | |
}, | |
}, | |
serve: { | |
on: { | |
ANOTHER_DONUT: 'ingredients', | |
}, | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment