Skip to content

Instantly share code, notes, and snippets.

@GABAnich
Created March 18, 2021 18:51
Show Gist options
  • Save GABAnich/b8889528f9df0d4ef34a82329dffa6be to your computer and use it in GitHub Desktop.
Save GABAnich/b8889528f9df0d4ef34a82329dffa6be 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: 'vacation',
initial: 'WAITING_FOR_MANAGER_APPROVE',
states: {
WAITING_FOR_MANAGER_APPROVE: {
on: {
MANAGER_APPROVE: 'WAITING_FOR_TEAM_APPROVE',
MANAGER_REJECT: 'REJECTED'
}
},
WAITING_FOR_TEAM_APPROVE: {
on: {
TEAM_APPROVE: 'ACCEPTED',
TEAM_REJECT: 'REJECTED'
}
},
ACCEPTED: {
type: 'final'
},
REJECTED: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment