~/talk

What Tamagotchis Can Teach You About ES6 Generators

Talkat JSConf Hawai 2019 · 2019-02-07..02-08· [javascript, reactive-programming]
slides:none on file

A web Tamagotchi is implemented in canvas with sprite animations and the repo is linked; initial version uses promises for animations and hits two problems: promise chaining becomes callback-hell and promises can’t be cancelled so user events wait for long idle loops. The app is rewritten to rewrite animations as generators, to yield promises and let a co-routine resume them, and to cancel or pause idle animation to immediately handle feed events — the generator + co routine approach works in the demo.

AI-written summary · about

  1. 0:00Start
  2. 5:52Creating the Main Game Loop
  3. 6:39Callback Health
  4. 11:09Pass Values into the Generators Next Function
  5. 12:26Create an Infinite Generator
  6. 16:51Co-Routines
  7. 18:50Co Routine To Handle Async Requests
  8. 21:37Draw Frame Generator
  9. 22:09Loop Generator
  10. 22:24While Loop
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.