Skip to content

Instantly share code, notes, and snippets.

@coodoo
Created April 20, 2019 23:39
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 coodoo/98ed68f437d071d09ce9debf1303ff45 to your computer and use it in GitHub Desktop.
Save coodoo/98ed68f437d071d09ce9debf1303ff45 to your computer and use it in GitHub Desktop.
Bus App
Bus App
idle
DOOR_OPEN -> loading
loading
DOOR_CLOSE -> stopped
#要放 cond 因為 close 不代表有放入 cd
loadError
#
stopped
ON_EJECT -> idle
ON_PLAY -> playing
ON_STOP -> stopped
FFD_START -> forwarding
RWD_START -> rewinding
ON_PAUSE -> paused
playing
ON_STOP -> stopped
FFD_START -> forwarding
RWD_START -> rewinding
ON_PAUSE -> paused
paused
ON_RESUME -> playing
# 其實要用 cond 決定回 stopped | playing
forwarding
FFD_STOP -> undetermined
rewinding
RWD_STOP -> undetermined
undetermined
function render(model){
let current_state_name = model.active_states[0].name;
return $("h1",
{style: {color: "darkBlue"}},
`The current state is: ${current_state_name}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment