Last active
March 2, 2021 01:17
-
-
Save njdancer/263e53bae869c0cb886ff435fab3d9cb 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 machine = Machine({ | |
id: 'categoryList', | |
initial: 'loading', | |
context: { | |
}, | |
states: { | |
loading: { | |
invoke: { | |
src: "loadData", | |
onDone: "categoryList" | |
} | |
}, | |
categoryList: { | |
on: { | |
"NEW_CATEGORY": { | |
target: "categoryEdit", | |
actions: "createDraftCategory" | |
}, | |
} | |
}, | |
categoryEdit: { | |
on: { | |
"SAVE": { | |
target: "categoryList", | |
actions: "saveDraftCategory" | |
}, | |
"CANCEL": { | |
actions: "resetDraftCategory" | |
} | |
} | |
}, | |
// activityList: { | |
// on: { | |
// "EDIT_CATEGORY": { | |
// target: "categoryEdit", | |
// actions: "copyAsDraftCategory" | |
// } | |
// } | |
// }, | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment