Go to content

Untangle your code with yield

Generators and iterators are among the most enigmatic and underused features of ECMAScript 2015. They can be used to create custom iterables and infinite sequences. Lesser known applications include controlling asynchronous operations and handling side effects. In this talk I'll demonstrate how generators can be successfully used to write elegant and performant code. I'll start by explaining how they work and what they are good for. I'll then show you how to bend the rules of space and time, and how to tame Promises and other abstractions with yield. Finally I'll present a hands-on example of how generators can be used to refactor code which otherwise would be tedious to maintain and reason about.

May 18, 2016