Created
April 1, 2021 00:15
-
-
Save pke/15b7ce280823feec9a973b9165f2f6b6 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const resolveThumbnailUUID = objectUUID => "652a83a0-1463-4d67-b9e2-474b32488c37" | |
const fetchMachine = Machine({ | |
id: 'thumbnails', | |
initial: 'loading', | |
context: { | |
objectUUID: "652a83a0-1463-4d67-b9e2-474b32488c37", | |
retries: 0 | |
}, | |
states: { | |
loading: { | |
on: { | |
FOUND: 'found', | |
NOTFOUND: 'create' | |
} | |
}, | |
found: { | |
type: 'final' | |
}, | |
create: { | |
on: { | |
GENERATED: { | |
target: 'upload' | |
} | |
} | |
}, | |
upload: { | |
on: { | |
SUCCESS: "found" | |
} | |
} | |
} | |
}, { | |
actions: { | |
resolveThumbnailUUID, | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment