Created
July 24, 2020 07:08
-
-
Save gpolaert/4a49e8adbb08eba80a8e54e314de2341 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) | |
| var stateMachine = Machine({ | |
| initial: 'selectable', | |
| context: { date: '' }, | |
| states: { | |
| selectable: { | |
| on: { | |
| IS_FROM: 'selectedBegin', | |
| IS_TO: 'selectedEnd', | |
| IS_BETWEEN_FROM_TO: 'selectedInRange' | |
| } | |
| }, | |
| selectedBegin: { | |
| on: { | |
| IS_TO: 'selectedEnd', | |
| IS_FROM_AND_TO: 'selectedOnly', | |
| IS_BETWEEN_FROM_TO: 'selectedInRange', | |
| IS_OUT_OF_RANGE: 'selectable' | |
| } | |
| }, | |
| selectedEnd: { | |
| on: { | |
| IS_FROM: 'selectedBegin', | |
| IS_FROM_AND_TO: 'selectedOnly', | |
| IS_BETWEEN_FROM_TO: 'selectedInRange', | |
| IS_OUT_OF_RANGE: 'selectable' | |
| } | |
| }, | |
| selectedOnly: { | |
| on: { | |
| IS_FROM: 'selectedBegin', | |
| IS_TO: 'selectedEnd' | |
| } | |
| }, | |
| selectedInRange: { | |
| on: { | |
| IS_FROM: 'selectedBegin', | |
| IS_TO: 'selectedEnd', | |
| IS_OUT_OF_RANGE: 'selectable' | |
| } | |
| } | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment