Created
July 7, 2020 11:38
-
-
Save pieh/610bc765e60b10833e63ade8229860ef 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: 'special', | |
states: { | |
special: { | |
on: { | |
// jokes on you I have different handling for this event | |
GO_TO_RANDOM1: 'random2', | |
GO_TO_RANDOM2: 'random1' | |
} | |
}, | |
random1: {}, | |
random2: {} | |
}, | |
on: { | |
GO_TO_SPECIAL: 'special', | |
GO_TO_RANDOM1: 'random1', | |
GO_TO_RANDOM2: 'random2' | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment