Skip to content

Instantly share code, notes, and snippets.

@saabi
Last active November 15, 2022 05:54
Show Gist options
  • Save saabi/ecb30545fcdcecd8229b89c7e2f776fc to your computer and use it in GitHub Desktop.
Save saabi/ecb30545fcdcecd8229b89c7e2f776fc to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
Machine({
"id": "MapRoute",
"initial": "UnknownPlatform",
"states": {
"UnknownPlatform": {
"on": {
"CLIENT_DETECTED": {
"target": "PageLanding"
}
}
},
"PageLanding": {
"invoke": {
"id": "FetchingData",
"src": "loadData",
"onDone": {
"target": "#MapRoute.PageInteractive",
"actions": [
"mergeDefaultsAndParams",
"updateEditingStores"
]
},
"onError": {
"target": "#MapRoute.PageError"
}
}
},
"PageError": {},
"PageInteractive": {
"on": {
"ROUTE_CHANGED": {
"target": "#MapRoute.PageInteractive",
"actions": [
"mergeDefaultsAndParams",
"updateEditingStores"
]
}
},
"states": {
"Editing": {
"initial": "Idle",
"states": {
"Idle": {
"entry": "computeOrgs",
"on": {
"TOGGLED_ORG_TYPE": {
"actions": [
"toggleOrgType",
"sendEdited",
"sendCommitted"
],
"target": "Idle"
},
"TOGGLED_ORG_TYPE_MODE": {
"actions": [
"toggleOrgTypeMode",
"sendEdited",
"sendCommitted"
],
"target": "Idle"
},
"EDITED_ORG_SEARCH_VALUE": {
"actions": [
"setOrgSearchValue",
"sendEdited",
"sendCommitted"
],
"target": "Idle"
},
"EDITED_PLACES_SEARCH_VALUE": {
"actions": [
"setPlacesSearchValue",
"sendEdited",
"sendCommitted"
],
"target": "Idle"
},
"EDITED_PLACE_IDS": {
"actions": [
"setPlaceIds",
"sendEdited",
"sendCommitted"
],
"target": "Idle"
},
"EDITED_REGION_IDS": {
"actions": [
"setRegionIds",
"sendEdited",
"sendCommitted"
],
"target": "Idle"
},
"EDITED_TOPIC_IDS": {
"actions": [
"setTopicIds",
"sendEdited",
"sendCommitted"
],
"target": "Idle"
}
}
}
}
},
"History": {
"initial": "Saved",
"states": {
"Saved": {
"on": {
"EDITED": {
"target": "Editing",
"actions": [
"initEntry"
]
}
}
},
"Editing": {
"on": {
"EDITED": {
"target": "Editing",
"actions": [
"updateEntry"
]
},
"COMMITTED": {
"target": "Saved",
"actions": [
"commitLastGoodURL"
]
}
}
}
}
}
},
"type": "parallel"
}
}
}, {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment