Untangle your code with yield
summary
Generators in ES2015 are used to build custom iterables and to control async flow by passing values back into paused functions; the talk shows a working formatter that uses yield unwraps wrapper values to collect errors instead of throwing, salvaging translations and reporting two errors in the demo. It uses writer/reader style composition to avoid threading error lists and context through every call, runs in modern browsers and Node 6, and relies on Babel/regenerator with a regenerator 1KB runtime to support older engines.
AI-written summary · about
chapters (10)
- 0:00Introduction to generators
- 3:10Iterables and iterators explained
- 8:13Pausing and state in iterators
- 12:58Beyond simple iteration
- 15:06Injecting values into generators
- 19:42Generators vs promises
- 23:21Real-world translation system
- 27:59Writers and error handling
- 31:37Readers and context passing
- 33:45Conclusion and availability
related talks
15mI Yield for Generators
31mPromises and Generators: control flow utopia
35mJavascript Generators
51mThe Miracle of Generators
28mWhat happens next: a choose-your-own-adventure with iterators
37mThe JavaScript of tomorrow, today
32mJavaScript 7: the Evolution of JavaScript
45mNext Generation Asynchronous Patterns in JavaScript
