Skip to content

Instantly share code, notes, and snippets.

@matthias-ccri
Last active September 14, 2021 15:56
Show Gist options
  • Save matthias-ccri/79079eacba3ba712bd1390002c7edf62 to your computer and use it in GitHub Desktop.
Save matthias-ccri/79079eacba3ba712bd1390002c7edf62 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 fetchMachine = Machine({
id: 'draw-tools',
initial: 'not_drawing',
states: {
not_drawing: {
on: {
PICK_TOOL: 'tool_selected',
}
},
tool_selected: {
on: {
DRAW_START: 'drawing_a_shape',
CLOSE: 'not_drawing',
}
},
drawing_a_shape: {
on: {
DRAW: 'drawing_a_shape',
DRAW_END: 'tool_selected',
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment