Skip to content

Instantly share code, notes, and snippets.

@devstojko
Last active April 2, 2021 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devstojko/a0ca1e801afa138e8fd46360d2168240 to your computer and use it in GitHub Desktop.
Save devstojko/a0ca1e801afa138e8fd46360d2168240 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchMachine = Machine({
id: 'fetch',
initial: 'WAITING_FIRST_ACTIVE_MARKER',
context: {
retries: 0
},
states: {
WAITING_FIRST_ACTIVE_MARKER: {
on: {
FIRST_MARKER_SELECTED: 'WAITING_SECOND_ACTIVE_MARKER',
}
},
WAITING_SECOND_ACTIVE_MARKER: {
on: {
SECOND_MARKER_SELECTED: "CONNECTED_MARKERS",
MARKER_DESELECTED: "WAITING_FIRST_ACTIVE_MARKER"
}
},
CONNECTED_MARKERS: {
on: {
MARKER_DESELECTED: "WAITING_SECOND_ACTIVE_MARKER",
RESET_MARKERS: "WAITING_FIRST_ACTIVE_MARKER"
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment