Skip to content

Instantly share code, notes, and snippets.

@NateRadebaugh
Last active November 4, 2019 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NateRadebaugh/d4aa4a31e08865f094375822a3a0f0d8 to your computer and use it in GitHub Desktop.
Save NateRadebaugh/d4aa4a31e08865f094375822a3a0f0d8 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// 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