Created
July 9, 2021 08:57
-
-
Save RafalFilipek/b33fa2bd1913d73141825ae87068df7e 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
Machine({ | |
id: 'foo', | |
initial: "load", | |
states: { | |
load: { | |
invoke: { | |
src: () => Promise.resolve(Math.random()), | |
onDone: [{ | |
target: 'ok', | |
cond: (_, e) => e.data > 0.5 | |
}, { | |
target: 'error' | |
}] | |
} | |
}, | |
ok: {}, | |
error: {}, | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment