Created
June 13, 2020 07:42
-
-
Save grabcode/193e720863e108e77778534975544e0a to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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
const splitA = { | |
id: 'splitA', | |
initial: 'qualifStep', | |
states: { | |
qualifStep: { | |
on: { | |
NEXT: 'emailStep' | |
}, | |
}, | |
emailStep: { | |
on: { | |
NEXT: 'thanksStep' | |
}, | |
}, | |
thanksStep: { | |
type: 'final' | |
}, | |
} | |
}; | |
const cfoLink = { | |
id: 'cfoLink', | |
initial: 'demoStep', | |
states: { | |
demoStep: { | |
on: { | |
NEXT: 'followupStep' | |
}, | |
}, | |
followupStep: { | |
on: { | |
NEXT: 'thanksStep' | |
}, | |
}, | |
thanksStep: { | |
type: 'final' | |
}, | |
} | |
}; | |
const nonCfoLink = { | |
id: 'nonCfoLink', | |
initial: 'qualifStep', | |
states: { | |
qualifStep: { | |
on: { | |
NEXT: 'demoStep' | |
}, | |
}, | |
demoStep: { | |
on: { | |
NEXT: 'followupStep' | |
}, | |
}, | |
followupStep: { | |
on: { | |
NEXT: 'thanksStep' | |
}, | |
}, | |
thanksStep: { | |
type: 'final' | |
}, | |
} | |
}; | |
const splitB = { | |
id: 'splitB', | |
initial: 'utm', | |
states: { | |
utm: { | |
'': 'cfoLink' | |
}, | |
cfoLink, | |
nonCfoLink | |
} | |
}; | |
const fsm = Machine({ | |
id: 'Complex', | |
initial: 'a/b test', | |
states: { | |
'a/b test': { | |
'': splitA | |
}, | |
splitA, | |
splitB | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment