Created
November 13, 2020 15:48
-
-
Save mindrones/92cf64f23b3c353da3839bc0dfd084a0 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
Machine({ | |
"id": "ExploreRoute", | |
"initial": "Interactive", | |
"on": {}, | |
"states": { | |
"Interactive": { | |
"type": "parallel", | |
"states": { | |
"History": { | |
"initial": "Idle", | |
"states": { | |
"Idle": { | |
"on": { | |
"EDITED": { | |
"target": "Idle", | |
"actions": "updateEntry" | |
} | |
} | |
} | |
} | |
}, | |
"Selecting": { | |
"initial": "Idle", | |
"states": { | |
"Idle": { | |
"entry": [ | |
"logEvent" | |
], | |
"on": { | |
"SELECTED_FIELDS": { | |
"target": "Idle", | |
"actions": [ | |
"selectFields", | |
"sendEdited" | |
] | |
}, | |
"CLICKED_FIELD_COUNTER": { | |
"target": "Idle", | |
"actions": [ | |
"toggleField", | |
"sendEdited" | |
] | |
}, | |
"SELECTED_NEXT_FIELD": { | |
"target": "Idle", | |
"actions": [ | |
"selectNextField", | |
"sendEdited" | |
] | |
}, | |
"SELECTED_PREVIOUS_FIELD": { | |
"target": "Idle", | |
"actions": [ | |
"selectPreviousField", | |
"sendEdited" | |
] | |
} | |
} | |
} | |
} | |
} | |
}, | |
"on": { | |
"DATASET_UPDATED": { | |
"target": "#ExploreRoute.Interactive", | |
"actions": [ | |
"storeDataset" | |
] | |
} | |
} | |
} | |
} | |
}, { | |
"actions": { | |
"logEvent": { | |
"type": "xstate.log", | |
"label": "logEvent", | |
"expr": (context, event) => `event: ${stringify(event)}, context: ${stringify(context)}` | |
}, | |
"storeDataset": { | |
"type": "xstate.assign", | |
"assignment": (ctx, {project, source, version}) => { | |
ctx.dataset.set({project, source, version}); | |
return ctx; | |
} | |
} | |
}, | |
"guards": {} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment