Skip to content

Instantly share code, notes, and snippets.

@NonLogicalDev
Created October 23, 2020 22:21
Show Gist options
  • Select an option

  • Save NonLogicalDev/4292fae83460d96067a32e4a65cf6247 to your computer and use it in GitHub Desktop.

Select an option

Save NonLogicalDev/4292fae83460d96067a32e4a65cf6247 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const m = Machine({
key: 'agent-probe',
initial: 'connecting',
states: {
connecting: {
on: {
"GRPC_CONNECTED": 'connected',
"GRPC_DISCONNECTED": 'connecting',
"CTX_DONE": 'shutdown',
}
},
connected: {
on: {
"GRPC_DISCONNECTED": 'connecting',
"ASSIGNMENT_MISMATCH": 'assignment_mismatch',
"CTX_DONE": 'shutdown',
},
},
assignment_mismatch: {
on: {
"GRPC_DISCONNECTED": 'connecting',
"REFRESH_SEND_ERROR": 'assignment_mismatch',
"REFRESH_SEND_SUCCESS": 'connected',
"CTX_DONE": 'shutdown',
}
},
shutdown: {
type: "final"
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment