From Callback Hell to the JavaScript “Promise” Land

THAT Conference 2014
Day: Mon, Aug 11   Time: 2:30 PM   Location: (map)
Level: 200  Primary Category: Web  Secondary Category: 
Tags: javascript, Promises, ECMAScript 6
We’ve all been there: buried 15 layers deep in JavaScript functions wondering where in the Callback Hell we are. How did we get here? Handling asynchronous code forces us to build an unmanageable stack of function calls, often leaving us buried beneath them. Is there a better way to handle this? Luckily, there is; I promise.

JavaScript promises give us an elegant way to handle asynchronous code. Through the power of its “then” method, we’re able to chain, instead of stack, our logic together. We’ll dive into the core of promises, as well as how to break apart common Callback Hell scenarios into beautiful method chains that’d make the most experienced developer shed a tear.