Last active
January 8, 2021 20:12
-
-
Save pix0r/f85417ecaf7c043c72aa34b0279702ea 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const otherMachine = Machine({ | |
id: 'updateStatus', | |
initial: 'view', | |
context: {}, | |
states: { | |
view: { | |
on: { | |
UPDATE_WITH_INPUT: 'show_form', | |
UPDATE_WITHOUT_INPUT: 'process_form', | |
}, | |
}, | |
show_form: { | |
on: { | |
SAVE: 'process_form', | |
}, | |
}, | |
show_form_errors: { | |
on: { | |
VIEW_ERRORS: 'show_form', | |
}, | |
}, | |
show_form_warnings: { | |
on: { | |
SAVE_ANYWAY: 'process_form', | |
CANCEL: 'view', | |
}, | |
}, | |
process_form: { | |
on: { | |
ERRORS: 'show_form_errors', | |
WARNINGS: 'show_form_warnings', | |
SUCCESS: 'view', | |
}, | |
}, | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment