Last active
September 14, 2021 15:56
-
-
Save matthias-ccri/79079eacba3ba712bd1390002c7edf62 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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