Last active
June 18, 2020 17:26
-
-
Save epan/76721b01d5f25154f5bbf36489566483 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
// V4 | |
// Transitions, assuming hasPrompts, no cancel, no fails, no loading (V4) | |
const simplifiedPromptsMachine = Machine({ | |
id: 'simplifiedPrompts', | |
initial: 'closed', | |
states: { | |
closed: { | |
on: { | |
OPEN: 'addressList' | |
} | |
}, | |
addressList: { | |
on: { | |
SELECT_EXISTING: 'consumerPromptSelect', | |
EDIT_EXISTING: 'consumerPromptEdit', | |
SELECT_NEW: 'consumerPromptNew' | |
} | |
}, | |
addressEditNew: { | |
on: { | |
SAVE: 'closed', | |
ADJUST_PIN: 'changePinLocationNew' | |
} | |
}, | |
addressEditExisting: { | |
on: { | |
SAVE: 'addressList', | |
ADJUST_PIN: 'changePinLocationNew' | |
} | |
}, | |
changePinLocationNew: { | |
on: { | |
SAVE: 'addressEditNew' | |
} | |
}, | |
changePinLocationExisting: { | |
on: { | |
SAVE: 'addressEditExisting' | |
} | |
}, | |
changePinLocationSelect: { | |
on: { | |
SAVE: 'closed' | |
} | |
}, | |
consumerPromptNew: { | |
on: { | |
AGREE: 'changePinLocationNew', | |
DECLINE: 'addressEditNew' | |
} | |
}, | |
consumerPromptSelect: { | |
on: { | |
AGREE: 'changePinLocationSelect', | |
DECLINE: 'closed' | |
} | |
}, | |
consumerPromptEdit: { | |
on: { | |
AGREE: 'changePinLocationExisting', | |
DECLINE: 'addressEditExisting' | |
} | |
}, | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment