Skip to content

Instantly share code, notes, and snippets.

@petrsavchenko
Created February 2, 2022 10:55
Show Gist options
  • Save petrsavchenko/30f60f5f33e841bff67c99dc04a1ea7e to your computer and use it in GitHub Desktop.
Save petrsavchenko/30f60f5f33e841bff67c99dc04a1ea7e to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchMachine = Machine({
id: "formState",
initial: 'inviteUser',
states: {
survey: {
on: {
NEXT: {
target: "inviteUser",
actions: { type: "changeScreen", payload: "inviteUser" }
}
}
},
inviteUser: {
on: {
PREVIOUS: {
target: "survey",
actions: { type: "changeScreen", payload: "survey" }
},
NEXT: {
target: "createProject",
actions: { type: "changeScreen", payload: "createProject" }
}
}
},
createProject: {
on: {
PREVIOUS: {
target: "inviteUser",
actions: { type: "changeScreen", payload: "inviteUser" }
}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment