Skip to content

Instantly share code, notes, and snippets.

@mmontone
Last active September 27, 2019 18:51
Show Gist options
  • Save mmontone/1e148edfba3bf14302630676d1ed3799 to your computer and use it in GitHub Desktop.
Save mmontone/1e148edfba3bf14302630676d1ed3799 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const UINavigator = Machine({
id: 'UI',
initial: 'running',
states: {
running: {
initial: 'home',
states: {
home: {
entry: ['home'],
on: {
bed: 'bedcontrols',
cpr: 'cpr',
presets: 'presets'
}
},
bedcontrols: {
initial: 'sideview',
states: {
sideview: {
entry: ['sideview'],
on: {
front: 'frontview',
perspective: 'perspectiveview'
}
},
frontview: {
entry: ['frontview'],
on: {
side : 'sideview',
perspective:'perspectiveview'
}
},
perspectiveview: {
entry: ['perspectiveview'],
on: {
side: 'sideview',
front: 'frontview'
}
}
},
on: {
home: 'home',
cpr: 'cpr',
presets: 'presets'
}
},
cpr: {
entry: ['cpr'],
on: {
home: 'home'
}
},
presets: {
entry: ['presets'],
on: {
home: 'home',
bed: 'bedcontrols'
}
},
hist: {
type: 'history',
history: 'deep'
}
},
on: {
stop: 'stopped',
block: 'blocked'
}
},
stopped: {
entry: ['stop'],
on: {
resume: 'running.hist',
cpr: 'running.cpr'
}
},
blocked: {
entry: ['lockscreen'],
on: {
stop: 'stopped',
unblock: 'running.hist'
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment