Get the latest tech news
Delimited Generators – A more natural API for JS generators
I have been studying ways to work around the horrors issues of JavaScript's async APIs for years. I have even built a series of increasing...
So I built delimgen, a thin layer on top of plain generators, that mimics delimited control. Delimited control is initially hard to understand, but once you grok it it's a very natural approach ( previous post). You also cannot do anything with this library that you couldn't do with plain generators, but for me, seeing that you can write quasi-blocking code in JS with some small overhead was a real eye opener.
Or read this on Hacker News