Skip to content

Instantly share code, notes, and snippets.

@matthewlehner
Last active March 2, 2020 21:14
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 matthewlehner/49b0c5d3e3358f6dc03741f546cdc41a to your computer and use it in GitHub Desktop.
Save matthewlehner/49b0c5d3e3358f6dc03741f546cdc41a to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const voteMachine = Machine({
id: "Phone Voting",
initial: "idle",
context: {},
states: {
idle: {
on: {
CALL_ANSWERED: "greetingMsg"
}
},
greetingMsg: {
on: {
GREETING_FINISHED: "pinPromptMsg"
}
},
pinPromptMsg: {
on: {
PIN_PROMPT_MSG_FINISHED: "pinPrompt"
}
},
pinPrompt: {
on: {
PIN_SUCCESS: "registrationNumberPromptMsg"
}
},
registrationNumberPromptMsg: {
on: {
REGISTRATION_PROMPT_MSG_FINISHED: "registrationNumberPrompt"
}
},
registrationNumberPrompt: {
on: {
REGISTRATION_NO_SUCCESS: "dobPromptMsg"
}
},
dobPromptMsg: {
on: {
DOB_PROMPT_MSG_FINISHED: "dobPrompt"
}
},
dobPrompt: {
on: {
DOB_SUCCESS: "voteDisclaimerMessage"
}
},
voteDisclaimerMessage: {
on: {
VOTE_DISCLAIMER_MESSAGE_COMPLETE: "ballotFlow"
}
},
ballotFlow: {
on: {
CAPTURE_ALL_BALLOT_OPTIONS: "recordBallot"
}
},
recordBallot: {
on: {
SERVER_RECORDED_BALLOT: "success"
}
},
success: {}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment