Last active
January 13, 2021 04:31
-
-
Save gurdasnijor/4a3b6f79d297120240fc3323504416be 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
const fetchMachine = Machine( { | |
initial: 'viewed_homepage', | |
states: { | |
viewed_homepage: { | |
meta: { | |
type: 'audience', | |
audience_ast: { } | |
}, | |
after:[ | |
{ | |
delay: 1000, | |
target: | |
'viewed_tops_without_buy', | |
cond: () => true | |
}, | |
{ | |
delay: 1000, | |
target: | |
'viewed_pants_without_buy', | |
cond: () => false | |
} | |
] | |
}, | |
viewed_tops_without_buy: { | |
on: { | |
"": [ | |
{ | |
target: 'viewed_tops_still_didnt_buy', | |
cond: () => true | |
}, | |
{ | |
target: 'finally_purchases_tops', | |
cond: () => false | |
} | |
] | |
} | |
}, | |
viewed_pants_without_buy: { | |
on: { | |
"": [ | |
{ | |
target: 'viewed_pants_still_didnt_buy', | |
cond: () => true | |
}, | |
{ | |
target: 'finally_purchases_pants', | |
cond: () => false | |
} | |
] | |
} | |
}, | |
viewed_tops_still_didnt_buy: { | |
}, | |
finally_purchases_tops: { | |
}, | |
viewed_pants_still_didnt_buy: { | |
}, | |
finally_purchases_pants: { | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment