Skip to content

Instantly share code, notes, and snippets.

@InsOpDe
Last active November 28, 2019 13:18
Show Gist options
  • Save InsOpDe/cc961ae1366d4399138bbd37efdad312 to your computer and use it in GitHub Desktop.
Save InsOpDe/cc961ae1366d4399138bbd37efdad312 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 contactMachine = Machine({
id: 'contact',
initial: 'wayOfContact',
states: {
wayOfContact: {
on: {
WE_CALL: 'threeColumns',
YOU_CALL: 'ourNumber',
YOU_MAIL: 'ourMail'
}
},
ourNumber: {
type: 'final'
},
ourMail: {
type: 'final'
},
threeColumns: {
on: {
BACK: 'wayOfContact',
ASSESSMENT: 'assessment',
CONSULTING: 'consulting',
PROCESS: 'process',
DONT_KNOW: 'dontKnow'
}
},
assessment: {
on: {
BACK: 'threeColumns',
NOTHING_SELECTED: 'noSelection',
FORWARD: 'contactForm'
}
},
consulting: {
on: {
BACK: 'threeColumns',
NOTHING_SELECTED: 'noSelection',
FORWARD: 'contactForm'
}
},
process: {
on: {
BACK: 'threeColumns',
NOTHING_SELECTED: 'noSelection',
FORWARD: 'contactForm'
}
},
dontKnow: {
on: {
BACK: 'threeColumns',
FORWARD: 'noSelection'
}
},
noSelection: {
on: {
BACK: 'threeColumns',
FORWARD: 'specify'
}
},
specify: {
on: {
BACK: 'threeColumns',
FORWARD: 'contactForm'
}
},
contactForm: {
on: {
BACK: 'threeColumns',
FORWARD: 'success'
}
},
success: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment