Last active
September 28, 2020 17:51
-
-
Save tomByrer/7dc16d2a8841d37e82115114eb5d1b7e 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
const radioItem = Machine( | |
{ | |
id: 'checkbox', | |
initial: 'nix', | |
states: { | |
nix: { | |
on: { | |
DISABLE: 'nixDisabled', | |
SELECT: 'aver', | |
}, | |
}, | |
nixDisabled: { | |
on: { | |
ENABLE: 'nix', | |
}, | |
}, | |
aver: { | |
entry: ['enterAver'], | |
exit: ['exitAver'], | |
on: { | |
RESET: 'nix', | |
AFFIRM: 'affirmed', | |
NEGATE: 'negated', | |
}, | |
}, | |
affirmed: { | |
type: 'final', | |
}, | |
negated: { | |
on: { | |
DISABLE: 'negatedDisabled' | |
}, | |
}, | |
negatedDisabled: { | |
type: 'final', | |
}, | |
}, | |
}, | |
{ | |
actions: { | |
enterAver: () => { | |
console.log("enterAver"); | |
}, | |
exitAver: () => { | |
console.log("exit Aver"); | |
}, | |
}, | |
}, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment