Last active
July 22, 2021 22:13
-
-
Save 2WheelCoder/f34eda0279b2872408f0e76144481793 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 explorerMachine = Machine({ | |
id: 'explorer', | |
initial: 'idle', | |
context: { | |
activeLayers: [], | |
filters: [], | |
geos: [], | |
networkLinks: [], | |
transitStops: [], | |
transitRoutes: [], | |
isFilterPanelOpen: [], | |
}, | |
states: { | |
idle: { | |
on: { | |
APPLY_LAYER_FILTER: 'loadingData', | |
EDIT_GEOS: 'selectingGeos', | |
EDIT_NETWORK_LINKS: 'selectingNetworkLinks', | |
EDIT_TRANSIT_STOPS: 'selectingTransitStops', | |
EDIT_TRANSIT_ROUTES: 'selectingTransitRoutes', | |
} | |
}, | |
loadingData: { | |
on: { | |
RESOLVE: 'idle', | |
REJECT: 'failure' | |
} | |
}, | |
loadingMap: { | |
on: { | |
RESOLVE: 'idle', | |
REJECT: 'failure' | |
} | |
}, | |
selectingGeos: {}, | |
selectingNetworkLinks: {}, | |
selectingTransitStops: {}, | |
selectingTransitRoutes: {}, | |
failure: {} | |
// failure: { | |
// on: { | |
// RETRY: { | |
// target: 'loading', | |
// actions: assign({ | |
// retries: (context, event) => context.retries + 1 | |
// }) | |
// } | |
// } | |
// } | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment