This talk is based on my experience building a Tamagotchi game in HTML5 Canvas and what I learned about promises, generators and coroutines in the process.
I’ll show the downside to promises (then-able hell) and why generators are the key to synchronous-looking async code.
What do Tamagotchis — everyone’s favorite digital pets from the 90s — and ES6 generators — pausible functions for async tasks — have in common?
Both are really fun to play with.
As a recent side project, I built a web-version of a Tamagotchi. But I struggled with one key element: how to handle a series of animations. What do you do when animations need to know that other animations are complete? What do you do when you’ve queued animations but a user event needs to be handle instead?
This talk explores where I went wrong (hint: promises) and what worked (hint: generators). You’ll leave this talk with a solid grasp of how to combine promises, generators, and coroutines for async work — whether it’s for a Tamagotchi or your day-to-day work.
Back to Proposals