Skip to content

Instantly share code, notes, and snippets.

@JacobBennett
Last active December 10, 2019 18: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 JacobBennett/9c410854b0c728d38d0a85e198c010cd to your computer and use it in GitHub Desktop.
Save JacobBennett/9c410854b0c728d38d0a85e198c010cd 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 fetchMachine = Machine({
id: 'wizard',
initial: 'involvement',
states: {
involvement: {
on: {
I_AM_AWARE: 'did_you_have_insurance',
I_AM_NOT_AWARE: 'dispute',
},
},
did_you_have_insurance: {
on: {
HAD_INSURANCE: 'insurance_form',
NO_INSURANCE: 'during_employment',
},
},
insurance_form: {
on: {
INSURANCE_FORM_SUBMIT: 'best_contact',
},
},
during_employment: {
on: {
IT_WAS_WORK_RELATED: 'employer_info_form',
NOT_WORK_RELATED: 'pay_your_claim',
},
},
employer_info_form: {
on: {
EMPLOYER_INFO_SUBMIT: 'best_contact',
},
},
dispute: {
on: {
I_WANT_TO_DISPUTE_THIS: 'dispute_claim_form',
DO_NOT_DISPUTE: 'pay_your_claim',
},
},
dispute_claim_form: {
on: {
SUBMIT_DISPUTE: 'best_contact',
},
},
best_contact: {
on: {
SUBMIT_BEST_CONTACT: 'thank_you',
SKIP_BEST_CONTACT: 'thank_you'
},
},
call_us: {
type: 'final',
},
pay_your_claim: {
type: 'final',
},
thank_you: {
type: 'final',
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment