Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Available variables:
- // - Machine
- // - interpret
- // - assign
- // - send
- // - sendParent
- // - spawn
- // - raise
- // - actions
- // - XState (all XState exports)
- const fetchMachine = Machine({
- id: 'consultation',
- initial: 'greeter',
- states: {
- greeter: {
- on: {
- NEXT: {
- target: 'insuranceTypeBinary',
- },
- },
- meta: {
- component: 'greeter',
- },
- },
- insuranceTypeBinary: {
- on: {
- CREDIT: {
- target: 'creditSliders',
- },
- FAMILY: {
- target: 'familySizeRadio',
- },
- },
- meta: {
- component: 'radio',
- },
- },
- creditSliders: {
- on: {
- SHOWADDON: {
- target: 'familyAddon',
- },
- NEXT: {
- target: 'insuranceRequirementsInput',
- },
- },
- meta: {
- component: 'inputSlider',
- },
- },
- familyAddon: {
- on: {
- ACCEPT: {
- target: 'familySizeRadio',
- },
- DENY: {
- target: 'insuranceRequirementsInput',
- },
- },
- meta: {
- component: 'binarySelect',
- },
- },
- creditAddon: {
- on: {
- ACCEPT: {
- target: 'creditSliders',
- },
- DENY: {
- target: 'insuranceRequirementsInput',
- },
- },
- meta: {
- component: 'binarySelect',
- },
- },
- familySizeRadio: {
- on: {
- NEXT: {
- target: 'familySliders',
- },
- },
- meta: {
- component: 'radio',
- },
- },
- familySliders: {
- on: {
- SHOWADDON: {
- target: 'creditAddon',
- },
- NEXT: {
- target: 'insuranceRequirementsInput',
- },
- },
- meta: {
- component: 'inputSlider',
- },
- },
- insuranceRequirementsInput: {
- type: 'final',
- meta: {
- component: 'dualIconInput',
- },
- },
- },
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement