Created
September 30, 2020 13:22
-
-
Save saadshahd/d16ebf0b7acf23781aca85fe19edf4e6 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 fetchMachine = Machine({ | |
id: 'fetch', | |
initial: 'NotImported', | |
context: { | |
retries: 0 | |
}, | |
states: { | |
NotImported: { | |
on: { | |
SBD_IMPORT_START: 'Processing', | |
}, | |
}, | |
Processing: { | |
on: { | |
SBD_IMPORT_SUCCESS: 'Available', | |
SBD_IMPORT_FAILED: 'Failed', | |
}, | |
}, | |
Failed: { | |
on: { | |
SBD_IMPORT_START: 'Processing', | |
}, | |
}, | |
Available: { | |
on: { | |
SBD_IMPORT_START: 'Updating', | |
}, | |
}, | |
Updating: { | |
on: { | |
SBD_IMPORT_SUCCESS: 'Updated', | |
SBD_IMPORT_FAILED: 'FailedUpdate', | |
}, | |
}, | |
Updated: { | |
on: { | |
SBD_IMPORT_START: 'Updating', | |
}, | |
}, | |
FailedUpdate: { | |
on: { | |
SBD_IMPORT_START: 'Updating', | |
}, | |
}, | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment