Last active
March 25, 2020 01:04
-
-
Save hnordt/53700cc7f69dfe7edc3bbe9666746647 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: 'collections', | |
initial: 'fetching', | |
states: { | |
fetching: { | |
invoke: { | |
src: "fetchCollections", | |
onDone: "success", | |
onError: "failure" | |
} | |
}, | |
success: { | |
on: { | |
SEARCH: 'fetching' | |
} | |
}, | |
failure: { | |
on: { | |
RETRY: 'fetching' | |
} | |
} | |
} | |
}); | |
// Machine({ | |
// id: 'collection', | |
// initial: 'idle', | |
// states: { | |
// idle: { | |
// on: { | |
// EDIT: "refetching", | |
// QUICK_EDIT: "quickEditing", | |
// DELETE: "deleting" | |
// } | |
// }, | |
// refetching: { | |
// initial: "pending", | |
// states: { | |
// pending: { | |
// invoke: { | |
// src: "fetchCollection", | |
// onDone: "success", | |
// onError: "failure" | |
// } | |
// }, | |
// success: { | |
// type: "final" | |
// }, | |
// failure: { | |
// on: { | |
// RETRY: 'pending' | |
// } | |
// } | |
// }, | |
// onDone: "editing" | |
// }, | |
// quickEditing: { | |
// initial: "idle", | |
// states: { | |
// idle: { | |
// on: { | |
// SUBMIT: "pending" | |
// } | |
// }, | |
// pending: { | |
// invoke: { | |
// src: "updateCollection", | |
// onDone: "success", | |
// onError: "failure" | |
// } | |
// }, | |
// success: { | |
// type: "final" | |
// }, | |
// failure: { | |
// on: { | |
// RETRY: 'pending' | |
// } | |
// } | |
// }, | |
// on: { | |
// CANCEL: "idle" | |
// }, | |
// onDone: "idle" | |
// }, | |
// editing: { | |
// initial: "fetchingUsers", | |
// states: { | |
// fetchingUsers: { | |
// initial: "pending", | |
// states: { | |
// pending: { | |
// invoke: { | |
// src: "fetchUsers", | |
// onDone: "success", | |
// onError: "failure" | |
// } | |
// }, | |
// success: { | |
// entry: "spawnUsers", | |
// type: "final" | |
// }, | |
// failure: { | |
// on: { | |
// RETRY: 'pending' | |
// } | |
// } | |
// }, | |
// onDone: "ready" | |
// }, | |
// ready: { | |
// initial: "idle", | |
// states: { | |
// idle: { | |
// on: { | |
// SUBMIT: "pending" | |
// } | |
// }, | |
// pending: { | |
// invoke: { | |
// src: "updateCollection", | |
// onDone: "success", | |
// onError: "failure" | |
// } | |
// }, | |
// success: {}, | |
// failure: { | |
// on: { | |
// RETRY: 'pending' | |
// } | |
// } | |
// } | |
// } | |
// }, | |
// on: { | |
// CANCEL: "idle" | |
// } | |
// }, | |
// reordering: { | |
// initial: "idle", | |
// states: { | |
// idle: { | |
// on: { | |
// SUBMIT: "pending" | |
// } | |
// }, | |
// pending: { | |
// invoke: { | |
// src: "reorderCollection", | |
// onDone: "success", | |
// onError: "failure" | |
// } | |
// }, | |
// success: {}, | |
// failure: { | |
// on: { | |
// RETRY: 'pending' | |
// } | |
// } | |
// }, | |
// on: { | |
// CANCEL: "idle" | |
// } | |
// }, | |
// deleting: { | |
// initial: "idle", | |
// states: { | |
// idle: { | |
// on: { | |
// SUBMIT: "pending" | |
// } | |
// }, | |
// pending: { | |
// invoke: { | |
// src: "deleteCollection", | |
// onDone: "success", | |
// onError: "failure" | |
// } | |
// }, | |
// success: {}, | |
// failure: { | |
// on: { | |
// RETRY: 'pending' | |
// } | |
// } | |
// }, | |
// on: { | |
// CANCEL: "idle" | |
// } | |
// } | |
// } | |
// }); | |
// Machine({ | |
// id: 'collectionUser', | |
// initial: 'idle', | |
// states: { | |
// idle: { | |
// on: { | |
// SELECT: "assigning", | |
// DESELECT: "unassigning" | |
// } | |
// }, | |
// assigning: { | |
// initial: "pending", | |
// states: { | |
// pending: { | |
// invoke: { | |
// src: "assign", | |
// onDone: "success", | |
// onError: "failure" | |
// } | |
// }, | |
// success: { | |
// type: "final" | |
// }, | |
// failure: { | |
// on: { | |
// RETRY: 'pending' | |
// } | |
// } | |
// }, | |
// onDone: "idle" | |
// }, | |
// unassigning: { | |
// initial: "pending", | |
// states: { | |
// pending: { | |
// invoke: { | |
// src: "unassign", | |
// onDone: "success", | |
// onError: "failure" | |
// } | |
// }, | |
// success: { | |
// type: "final" | |
// }, | |
// failure: { | |
// on: { | |
// RETRY: 'pending' | |
// } | |
// } | |
// }, | |
// onDone: "idle" | |
// } | |
// } | |
// }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment