Skip to content

Instantly share code, notes, and snippets.

@jaetask
Last active January 11, 2021 11:01
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 jaetask/616222402239a9a04b664a1ac9e55a6d to your computer and use it in GitHub Desktop.
Save jaetask/616222402239a9a04b664a1ac9e55a6d 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 apiMachine = Machine({
id: 'api',
initial: 'offline',
context: {
},
states: {
offline: {
on: {
ONLINE: 'online',
REQUEST: {
target: 'offline',
actions: []
}
}
},
online: {
on: {
OFFLINE: 'offline'
}
}
}
}, {
actions: {
saveRequest: () => {}
},
guards: {
canSaveRequest: () => {}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment