Created
June 7, 2020 01:17
-
-
Save davidkpiano/3c9935be5bf8db7d600f6742df6a7ee9 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
const donutMachine = 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_DRY: 'mixed' } | |
}, | |
mixed: { | |
type: 'final' | |
} | |
} | |
} | |
}, | |
onDone: 'allMixed' | |
}, | |
allMixed: { | |
type: 'final' | |
}, | |
} | |
}, | |
fry: {}, | |
flip: {}, | |
dry: {}, | |
glaze: {}, | |
serve: {} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment