Skip to content

Instantly share code, notes, and snippets.

@msell
Created February 12, 2021 18:28
Show Gist options
  • Select an option

  • Save msell/bf38d0b241903ac9cc66ae78134453c1 to your computer and use it in GitHub Desktop.

Select an option

Save msell/bf38d0b241903ac9cc66ae78134453c1 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'aog',
initial: 'open',
context: {
},
states: {
open: {
initial: 'initial',
on: {
STALL: 'stalled',
RESOLVE: 'resolved'
},
states: {
initial: {
on: {
MRO_SELECTED: 'mechanic_requested',
}
},
mechanic_requested: {
on: {
MECHANIC_RESPONDS: 'pending_assignment'
}
},
pending_assignment: {
on: {
ASSIGN_MECHANIC: 'mechanic_assigned',
}
},
mechanic_assigned: {
on: {
MECHANIC_CANCELED: 'mechanic_requested'
},
},
history: {
type: 'history'
}
}
},
stalled: {
on: {
resume: 'open.history'
}
},
resolved: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment