What Tamagotchis Can Teach You About ES6 Generators
summary
A web Tamagotchi is built in canvas with sprite sheets and setTimeout-driven frames, then rewritten from promise chains to ES6 generators so animations can be paused, resumed and cancelled. The concrete claims: promises can't be cancelled, generators can via return and yield delegation, and a small co-routine handling async* glue awaits yielded promises. The demo shows an event queue, a generator game loop, and the final game working live — useful if the goal is practical generator control flow.
AI-written summary · about
chapters (8)
- 0:00Start
- 1:22Draw on the Canvas
- 3:03Delay the Animations
- 4:41Bounce of Animations
- 10:45Pass Values into a Generator Index Function
- 11:46Create a Generator That Runs for Forever
- 19:29Idle Animations
- 20:28Dislike Animation
related talks
25mWhat Tamagotchis Can Teach You About ES6 Generators
26mWhat Tamagotchis can teach you about generators
15mI Yield for Generators
31mPromises and Generators: control flow utopia
36mThe Power of JS Generators
45mNext Generation Asynchronous Patterns in JavaScript
32mJavaScript 7: the Evolution of JavaScript
35mJavascript Generators
