Last active
August 6, 2019 09:24
-
-
Save kojinkai/0b594fa62472bc9cbc6f68f2384ec218 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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', | |
}, | |
}, | |
}, | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment