Skip to content

Instantly share code, notes, and snippets.

@tomByrer
Last active September 17, 2020 03:48
Show Gist options
  • Save tomByrer/64bc1077eb6cb3697c515ab783963f50 to your computer and use it in GitHub Desktop.
Save tomByrer/64bc1077eb6cb3697c515ab783963f50 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const labelSwitch = Machine(
{
id: 'labelSwitch',
initial: 'nix',
context: {
retries: 0
},
states: {
nix: {
entry: ['activateNix'],
on: {
CHECK: 'aver',
nix_LABEL: 'aver',
},
},
aver: {
on: {
UNCHECK: {
target: 'nix',
},
AVER_LABEL: 'nix',
},
},
},
},
{
actions: {
activateNix: () => {
console.log("activateNix");
},
},
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment