Last active
January 2, 2021 03:47
-
-
Save pavankataria/4ed6f8f87eff00d90c2d5e2f02da4874 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or 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
// A very cool visualisation machine | |
// Allows you to see what the state machine does | |
// And how it transitions from one state to the next | |
const toggleMachine = new Machine({ | |
id: 'toggleMachine', | |
initial: 'inactive', | |
states: { | |
inactive: { | |
// Tell it which events the state should listen for. | |
// And you do that by defining an on property. | |
on: { | |
TOGGLE: 'active' | |
} | |
}, | |
active: { | |
on: { | |
TOGGLE: 'inactive' | |
} | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment