Skip to content

Instantly share code, notes, and snippets.

@sarahdayan
Last active February 16, 2020 13:55
Show Gist options
  • Save sarahdayan/f582c0f27384dcad4f92dea64d94d940 to your computer and use it in GitHub Desktop.
Save sarahdayan/f582c0f27384dcad4f92dea64d94d940 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const toggleMachine = Machine({
id: "toggle",
initial: "visible",
states: {
visible: {
on: {
TOGGLE: "hidden"
},
initial: "rendered",
states: {
rendered: {
on: {
SWAP: "raw"
}
},
raw: {
on: {
SWAP: "rendered"
}
},
memo: {
type: 'history'
}
}
},
hidden: {
on: {
TOGGLE: "visible.memo"
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment