Created
September 19, 2020 20:16
-
-
Save zaydek/67a25793238aac6aa8c9f876c2670e99 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or 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 delayedTransientRefetchForeverMachine = Machine({ | |
id: "delayedTransientRefetchForever", | |
initial: "fetching", | |
states: { | |
fetching: { | |
invoke: { | |
id: "fetchHandler", | |
src: (ctx, e) => new Promise((resolve, reject) => { | |
setTimeout(() => { | |
reject() | |
}, 1e3) | |
}), | |
onDone: "success", | |
onError: "failure", | |
}, | |
}, | |
failure: { | |
after: { | |
1e3: "fetching", | |
} | |
}, | |
success: { | |
type: "final", | |
}, | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment