Skip to content

Instantly share code, notes, and snippets.

@tomByrer
Last active September 5, 2020 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomByrer/cc34cf57e1cd5fc378480cb63b91d661 to your computer and use it in GitHub Desktop.
Save tomByrer/cc34cf57e1cd5fc378480cb63b91d661 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine(
{
id: 'checkbox',
initial: 'down',
context: {
retries: 0
},
states: {
down: {
on: {
FLIP: {
actions: "myAction",
target: "up"
},
}
},
up: {
on: {
FLIP: 'down'
}
},
}
},
{
actions: {
myAction: () => {
console.log("myAction");
}
}
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment