Created
October 7, 2020 18:49
-
-
Save sukima/11e6b1acec2e730d4167c5ac43f0f562 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 fetchMachine = Machine({ | |
id: 'wizard', | |
initial: 'details', | |
context: {}, | |
states: { | |
cancelled: { | |
type: 'final', | |
entry: 'closeModal', | |
}, | |
details: { | |
initial: 'invalid', | |
on: { | |
PREV: 'cancelled', | |
}, | |
states: { | |
invalid: { | |
id: 'invalid', | |
on: { | |
VALID: 'valid', | |
SERVER_VALIDATING: 'validating.remain', | |
}, | |
}, | |
valid: { | |
id: 'valid', | |
on: { | |
INVALID: 'invalid', | |
SERVER_VALIDATING: 'validating.remain', | |
NEXT: 'validating.next', | |
}, | |
}, | |
validating: { | |
states: { | |
remain: { | |
on: { | |
SERVER_VALID: '#valid', | |
SERVER_INVALID: '#invalid', | |
NEXT: 'next', | |
}, | |
}, | |
next: { | |
on: { | |
SERVER_VALID: '#affectedSummary', | |
SERVER_INVALID: '#invalid', | |
}, | |
}, | |
}, | |
}, | |
}, | |
}, | |
affectedSummary: { | |
id: 'affectedSummary', | |
}, | |
}, | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment