Last active
October 8, 2021 16:48
-
-
Save YouMinTW/f8a75b80c6369778e30e1429e0773fb6 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
const inputMachine = Machine({ | |
id: "inputMachine_v1", | |
type: "parallel", | |
states: { | |
valid: { | |
initial: "valid", | |
states: { | |
invalid: { | |
on: { | |
VALIDATE: { target: "valid" }, | |
}, | |
}, | |
valid: { | |
on: { | |
INVALIDATE: { target: "invalid" }, | |
}, | |
}, | |
}, | |
}, | |
enabled: { | |
initial: "enabled", | |
states: { | |
disabled: { | |
on: { | |
ENABLE: { target: "enabled" } | |
} | |
}, | |
enabled: { | |
on: { | |
DISABLE: { target: "disabled" } | |
} | |
} | |
} | |
}, | |
changed: { | |
initial: "unchanged", | |
states: { | |
unchanged: { | |
on: { | |
CHANGE: { target: "changed" }, | |
}, | |
}, | |
changed: { | |
on: { | |
REVERT_CHANGE: { target: "unchanged" }, | |
}, | |
}, | |
}, | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment