Skip to content

Instantly share code, notes, and snippets.

@tomByrer
Created November 6, 2020 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomByrer/c2871b16978e9312d44fe0edfa7051c3 to your computer and use it in GitHub Desktop.
Save tomByrer/c2871b16978e9312d44fe0edfa7051c3 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const verifyChoice = Machine({
id: 'vc',
type: 'parallel',
states: {
choiceA: {
initial: 'empty',
states: {
empty: {
on: {
CLICK: 'selected',
VERIFY: 'unselectedAnswer',
FAIL: 'unselctedFailure',
}
},
selected: {
on: {
CLICK: 'empty',
VERIFY: 'correctAnswer',
FAIL: 'selectedFailure',
}
},
unselectedAnswer: {},
correctAnswer: {},
unselctedFailure: {},
selectedFailure: {},
},
},
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment