Carlos Vega
Feb 23, 2017 · 1 min read

Yeah, that’s just an example of a callback hell to illustrate a point. Going deeper than that (e.g. transforming that to a Promise based implementation) isn’t within the scope of the article which is basically about using Koa 2 with async/await.

That section was added as an introduction to the issue with callbacks (which used to be the main way of working with async actions in Express), if someone wants to dig deeper into that specific problem domain, the last paragraph of that section offers a series of useful reference links:

“Since this is not the main topic of this post I’ll just say that newer versions of JavaScript (ES2015, ES2016 and ESNext) have all contributed to address this issue using Promises, Generators and async/await (follow the links if you’ve never heard of those before reading on).”

Going into details about Promises, Generators and async/await could inspire not one but a complete series of articles for each of those topics on their own.

    Carlos Vega

    Written by

    Software engineer in love with web development. Avid reader and occasional blogger. He will blog about anything that crosses his mind. Costa Rica.

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade