Skip to content

Instantly share code, notes, and snippets.

@Tarabyte
Last active January 13, 2021 14:35
Show Gist options
  • Save Tarabyte/ed6e08aa3f7f2dfbc6a371395cf23d0d to your computer and use it in GitHub Desktop.
Save Tarabyte/ed6e08aa3f7f2dfbc6a371395cf23d0d to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const ParticipantSurveyMachine = Machine({
id: 'participantSurvey',
initial: 'empty',
context: {
survey: null
},
states: {
empty: {
on: {
selectedByAdmin: 'selected'
}
},
selected: {
on: {
startedByAdmin: 'started.hist',
closeByAdmin: 'empty'
}
},
started: {
initial: 'notAnswered',
on: {
stoppedByAdmin: 'selected'
},
states: {
notAnswered: {
on: {
answer: 'answered'
}
},
answered: {},
hist: { type: 'history' }
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment