Skip to content

Instantly share code, notes, and snippets.

@rreckonerr
Created March 2, 2021 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rreckonerr/5d90fe25a93b2979de3adf3b37edb293 to your computer and use it in GitHub Desktop.
Save rreckonerr/5d90fe25a93b2979de3adf3b37edb293 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: 'wake-up-call-modal',
initial: 'select-item-step',
context: {},
states: {
"select-item-step": {
on: {
NEXT: {
target: "select-method-step"
},
CLOSE: {
action: "closeModal"
}
}
},
"select-method-step": {
on: {
CLOSE: {
action: "closeModal"
}
}
},
success: {
type: 'final',
entrt: "closeModal"
},
failure: {
entry: "closeModal"
}
},
actions: {
closeModal: () => {
console.log("closeModal triggered")
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment