Javascript Generators
summary
Covers JavaScript generator functions (function* and yield), how they work under the hood and how to use them in practice, with examples and patterns for asynchronous flow control and iterable protocols. Discusses interactions with promises, async/await, and how generators can simplify or structure complex code in modern JavaScript environments.
AI-written summary Β· about
chapters (24)
- 0:00Intro
- 2:12Confy app (2015) - Redux-Sagas + generators
- 4:34Quick intro to generators
- 5:53What are iterables?
- 6:11What does it mean to be iterable?
- 7:26What is an iterator?
- 8:20for...of (under the hood)
- 10:12Generators and generator functions
- 11:49A simple generator function..
- 13:59for...of with generators
- 15:49Lazy (infinite) sequences (for...of)
- 16:45Fibonacci sequence ... again
- 17:38Reducing transformations
- 18:54Traversing trees
- 20:35Passing values into a generator
- 23:11Additional generator methods
- 23:36External control flow (throwing)
- 24:33External control flow (returning)
- 25:15Driving the state machine
- 25:34Instrumenting code (logging)
- 26:51Instrument code (mobx flow)
- 28:32Control flow: pausing a generator
- 29:43Control flow: cancelling a generator
- 33:52Further Reading
related talks
15mI Yield for Generators
30mJavaScript Generators β Practical Use Cases
31mPromises and Generators: control flow utopia
35mUntangle your code with yield
45mNext Generation Asynchronous Patterns in JavaScript
32mJavaScript 7: the Evolution of JavaScript
51mThe Miracle of Generators
32mThe Evolution Of Asynchronous Javascript
