Skip to content

Instantly share code, notes, and snippets.

@laughnan
Created May 3, 2020 07:29
Show Gist options
  • Save laughnan/58b884893b306af34947775366d81277 to your computer and use it in GitHub Desktop.
Save laughnan/58b884893b306af34947775366d81277 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const ordersTooltipExperienceMachine = Machine({
id: "ordersTooltipExperienceV0",
initial: "init",
context: {
flowName: "ordersTooltipExperience",
},
states: {
init: {
on: {
START_IF_ELIGIBLE: {
target: "seeMoreOrders",
cond: 'canShow',
},
}
},
seeMoreOrders: {
entry: ['onShow'],
on: {
DISMISS_TOOLTIP: {
target: "ordersMenuItem"
}
}
},
ordersMenuItem: {
on: {
DISMISS_TOOLTIP: {
target: "completed"
}
}
},
completed: {
entry: ['onClose'],
},
}
}, {
actions: {
onClose: () => console.log('on close'),
onShow: () => console.log('on show'),
},
guards: {
canShow: () => true,
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment