Skip to content

Instantly share code, notes, and snippets.

@RafalFilipek
Created November 21, 2019 10:27
Show Gist options
  • Save RafalFilipek/7d801bb0af9c2d23f93b2cdb1139048e to your computer and use it in GitHub Desktop.
Save RafalFilipek/7d801bb0af9c2d23f93b2cdb1139048e to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const suflerMachine = Machine({
initial: "types",
states: {
types: {
on: {
SELECT_TYPE: {
target: "processes",
actions: [
assign({
typeId: (_context, event) => event.id
})
]
}
}
},
processes: {
on: {
SELECT_PROCESS: {
target: "offers",
actions: [
assign({
processId: (_context, event) => event.id
})
]
},
BACK: "types"
}
},
offers: {
type: "final"
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment