Created
June 23, 2020 01:16
-
-
Save gertig/f3bff09b5f88f6ba531fc380055e51fb 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
const integrationMachine = Machine({ | |
id: "integration", | |
initial: "noAuthorization", | |
states: { | |
noAuthorization: { | |
on: { | |
OAUTH_SUCCESS: "needsSiteSelection", | |
HAS_SITE: "needsCollectionSelection", | |
HAS_COLLECTION: "needsFieldMapping", | |
}, | |
}, | |
needsSiteSelection: { | |
on: { | |
GET_SITES_REQUESTED: "loadingSites", | |
SITE_SELECTED: "needsCollectionSelection", | |
}, | |
}, | |
loadingSites: { | |
on: { | |
GET_SITES_SUCCESS: "needsSiteSelection", | |
GET_SITES_FAILURE: "needsSiteSelection", | |
}, | |
}, | |
needsCollectionSelection: { | |
on: { | |
GET_COLLECTIONS_REQUESTED: "loadingCollections", | |
COLLECTION_SELECTED: "needsFieldMapping", | |
}, | |
}, | |
needsFieldMapping: {}, | |
loadingCollections: { | |
on: { | |
// GET_SITES_SUCCESS: "noSiteSaved", | |
}, | |
}, | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment