Created
December 22, 2020 08:01
-
-
Save MarceloAlves/f469e1e645d57637b96c0dc6b28643cf 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const cookMachine = Machine({ | |
id: 'cook', | |
initial: 'idle', | |
context: { | |
logCount: 0 | |
}, | |
states: { | |
idle: {}, | |
open: {}, | |
inprogress: { | |
states: { | |
idle: { | |
on: { | |
ADD_LOG: '#cook.inprogress.modalOpen' | |
} | |
}, | |
modalOpen: { | |
on: { | |
SUBMIT_FORM: { | |
invoke: 'addLog', | |
onDone: '#cook.inprogress.idle' | |
} | |
} | |
}, | |
adding: { | |
} | |
} | |
}, | |
closed: { | |
type: 'final' | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment