Created
March 2, 2021 20:07
-
-
Save rreckonerr/5d90fe25a93b2979de3adf3b37edb293 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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