Last active
November 4, 2019 04:19
-
-
Save NateRadebaugh/d4aa4a31e08865f094375822a3a0f0d8 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const datePickerMachine = Machine({ | |
id: 'datePicker', | |
initial: 'idle', | |
states: { | |
idle: { | |
on: { | |
CLICK: 'open', | |
FOCUS: 'open' | |
} | |
}, | |
open: { | |
on: { | |
BLUR: 'idle', | |
ENTER: 'idle', | |
SELECT: 'idle' | |
}, | |
initial: 'days', | |
states: { | |
time: { | |
on: { | |
DAYS: 'days' | |
} | |
}, | |
days: { | |
on: { | |
MONTHS: 'months', | |
TIME: 'time' | |
} | |
}, | |
months: { | |
on: { | |
DAYS: 'days', | |
SELECT: 'days', | |
YEARS: 'years' | |
} | |
}, | |
years: { | |
on: { | |
MONTHS: 'months', | |
SELECT: 'months' | |
} | |
} | |
} | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment