Last active
September 27, 2019 18:51
-
-
Save mmontone/1e148edfba3bf14302630676d1ed3799 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or 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
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