Skip to content

Instantly share code, notes, and snippets.

@NonLogicalDev
Last active October 7, 2020 00:46
Show Gist options
  • Select an option

  • Save NonLogicalDev/2b1d57c70f5bda96407f065908160e03 to your computer and use it in GitHub Desktop.

Select an option

Save NonLogicalDev/2b1d57c70f5bda96407f065908160e03 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