Created
April 24, 2020 04:29
-
-
Save mattmazzola/4e85585fd3d5a3151b33335588e1899d 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
const testStateMachine = Machine({ | |
id: 'testState', | |
initial: 'preload', | |
states: { | |
preload: { | |
on: { | |
LOAD: { | |
target: 'ready', | |
}, | |
}, | |
}, | |
ready: { | |
on: { | |
START: { | |
target: 'started', | |
}, | |
} | |
}, | |
started: { | |
on: { | |
END: { | |
target: 'ended', | |
} | |
} | |
}, | |
ended: { | |
initial: 'overview', | |
on: { | |
RESTART: { | |
target: 'preload', | |
}, | |
}, | |
states: { | |
overview: { | |
on: { | |
DETAILS: { | |
target: 'details' | |
} | |
}, | |
}, | |
details: { | |
on: { | |
OVERVIEW: { | |
target: 'overview' | |
} | |
} | |
}, | |
} | |
}, | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment