Last active
December 14, 2019 19:39
-
-
Save colebemis/c96ff5c8a1d1e04e63fa2998c4029191 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 fetchMachine = Machine({ | |
id: 'fetch', | |
initial: 'closed', | |
states: { | |
closed: { | |
on: { | |
OPEN: 'open' | |
} | |
}, | |
open: { | |
on: { | |
CLOSE: 'closed' | |
}, | |
initial: 'compose', | |
states: { | |
compose: { | |
on: { | |
SEND: 'sending' | |
} | |
}, | |
sending: { | |
on: { | |
RESOLVE: 'sent', | |
REJECT: 'error' | |
} | |
}, | |
sent: {type:'final'}, | |
error: { | |
on: { | |
SEND: 'sending', | |
} | |
} | |
} | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment