Skip to content

Instantly share code, notes, and snippets.

@zzzzBov
Last active January 24, 2021 21:51
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 zzzzBov/dfc8b9302ab49df21d554f2644a225cc to your computer and use it in GitHub Desktop.
Save zzzzBov/dfc8b9302ab49df21d554f2644a225cc 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: "opener",
initial: "closed",
context: {},
states: {
closed: {
id: "closed",
on: {
OPEN: "opened",
TOGGLE: "opened",
},
},
opened: {
initial: "idle",
states: {
idle: {
on: {
AUTOCLOSE: "closing",
},
},
closing: {
on: {
CANCEL: "idle",
},
after: {
0: "close",
},
},
close: {
type: "final",
},
},
on: {
CLOSE: "closed",
TOGGLE: "closed",
},
onDone: "closed",
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment