Skip to content

Instantly share code, notes, and snippets.

@signaes
Last active August 31, 2020 15:36
Show Gist options
  • Save signaes/c3b0802e95db399de8b2d56dc8c83b31 to your computer and use it in GitHub Desktop.
Save signaes/c3b0802e95db399de8b2d56dc8c83b31 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 defineProgramMobileMachine = Machine({
id: 'defineProgramMobile',
initial: 'idle',
context: {
retries: 0
},
states: {
idle: {
on: {
DEFINE_WORKOUTS: 'define_workouts',
WEEKLY_VIEW: 'weekly_view',
}
},
define_workouts: {
on: {
BACK: 'idle',
COMMIT: 'idle',
},
},
weekly_view: {
initial: 'idle',
states: {
idle: {
on: {
BACK: '#defineProgramMobile.idle',
DEFINE_WORKOUTS: 'define_workouts',
DEFINE_DAY: 'define_day',
},
},
define_workouts: {
on: {
BACK: 'idle',
COMMIT: 'idle',
},
},
define_day: {
on: {
BACK: 'idle',
COMMIT: 'idle',
},
},
}
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment