Last active
January 27, 2021 13:51
-
-
Save ajayullal/1ff37a368739a7b61914ab7efe0945f0 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or 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: 'Create SSL Quote', | |
initial: 'Home', | |
states: { | |
Home: { | |
on: { | |
'Create SSL Quote Button Click': 'Opportunities' | |
} | |
}, | |
Opportunities: { | |
on: { | |
'Search account': 'Opportunities.Display accounts list', | |
'Click on next': 'Contract' | |
}, | |
initial: 'Display Selected Account', | |
states: { | |
'Display accounts list': { | |
entry: ['fetch accounts'], | |
on: { | |
'Select Account': 'Display Selected Account', | |
'Clear selected account': 'Disable next button' | |
} | |
}, | |
'Display Selected Account': { | |
entry: ['Display placeholder text if no account is selected', | |
'List account opportunities' | |
] | |
}, | |
'List account opportunities': { | |
entry: ['fetch account opportunities'], | |
on: { | |
'Select': 'Enable next button' | |
} | |
}, | |
'Enable next button': { | |
}, | |
'Disable next button': {} | |
} | |
}, | |
Contract: { | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment