Skip to content

Instantly share code, notes, and snippets.

@dhargitai
Last active November 16, 2020 07:57
Show Gist options
  • Save dhargitai/be6ab9fb225ab8eee871e564ffb541cd to your computer and use it in GitHub Desktop.
Save dhargitai/be6ab9fb225ab8eee871e564ffb541cd 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 iqrsDeviceMachine = Machine({
id: 'referenceDevice',
initial: 'expected',
states: {
expected: {
on: {
PING: 'standBy',
}
},
standBy: {
on: {
EXCEPTION: 'problem',
WORK: 'initializing',
}
},
initializing: {
on: {
DONE: 'working',
EXCEPTION: 'problem',
}
},
working: {
on: {
STOP: 'standBy',
EXCEPTION: 'problem',
}
},
problem: {
on: {
RESOLVE: 'standBy',
REJECT: 'expected',
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment