Created
September 22, 2020 11:52
-
-
Save davepies/e87b0035d69c8d6e498afcc8868fed8c 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
const formMachine = Machine({ | |
id: "siteProfileForm", | |
initial: "notSubmittable", | |
states: { | |
notSubmittable: { | |
on: { FORM_COMPLETE: "submittable" }, | |
}, | |
submittable: { | |
on: { | |
TOGGLE_SITE_VALIDATION: "validateTargetSite", | |
SUBMIT: "submitted", | |
}, | |
}, | |
submittableWithValidatedTargetSite: { | |
on: { | |
SUBMIT: "submitted", | |
}, | |
}, | |
validateTargetSite: { | |
on: { | |
VALIDATION_START: "validateTargetSiteInProgress", | |
TOGGLE_SITE_VALIDATION: "submittable", | |
}, | |
}, | |
validateTargetSiteInProgress: { | |
on: { | |
VALIDATION_SUCCESS: "submittableWithValidatedTargetSite", | |
}, | |
}, | |
submitted: {}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment