generator functions exist, which is not even needed in this case, you could just pass a promise as an argument
Of course, you don't need a channel abstraction to do that. To me, channels are the most intuitive and self-contained way to solve the problem, so I wanted to use that model of concurrency in JS.