Skip to content

Instantly share code, notes, and snippets.

@christiannwamba
Created May 14, 2020 17:44
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 christiannwamba/984e32d3188c514719d9d7aee103d8d0 to your computer and use it in GitHub Desktop.
Save christiannwamba/984e32d3188c514719d9d7aee103d8d0 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// DEMO: Calling events from other events
const echoMachine = Machine({
id: "echo",
initial: "listening",
states: {
listening: {
on: {
SPEAK: {
// Calls the ECHO action
actions: send("ECHO")
},
ECHO: {
actions: () => {
console.log("echo, echo");
}
}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment