Skip to content

Instantly share code, notes, and snippets.

@laughnan
Created May 3, 2020 07:29
Show Gist options
  • Save laughnan/6f9503d8fe15b2c07423a9dea854152e to your computer and use it in GitHub Desktop.
Save laughnan/6f9503d8fe15b2c07423a9dea854152e to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const ordersOverviewExperienceMachine = Machine({
id: "ordersOverviewExperienceV2",
initial: "init",
context: {
flowName: "ordersOverviewExperience"
},
states: {
init: {
entry: () => console.log("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", "onComplete"]
}
}
}, {
actions: {
onClose: () => console.log(''),
onComplete: () => console.log(''),
onShow: () => console.log('')
},
guards: {
canShow: () => true,
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment