Skip to content

Instantly share code, notes, and snippets.

@AndresRodH
Created May 18, 2020 17:33
Show Gist options
  • Save AndresRodH/5c04abe1e34146341531f36956b3c5fe to your computer and use it in GitHub Desktop.
Save AndresRodH/5c04abe1e34146341531f36956b3c5fe 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 mobileNavMachine = Machine({
id: 'mobileNav',
initial: 'closed',
states: {
open: {
on: { TOGGLE_NAV: 'closed' },
initial: 'menu',
states: {
menu: {
on: {
TOGGLE_NAV: '#mobileNav.closed',
TOGGLE_SETTINGS: 'settings'
}
},
settings: {
on: {
TOGGLE_NAV: '#mobileNav.closed',
TOGGLE_SETTINGS: 'menu'
}
}
},
},
closed: {
on: { TOGGLE_NAV: 'open' },
},
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment