What's callback hell and what the hell are Promises?? To dive into those questions requires some basic understanding of the Javascript callstack, ...
For further actions, you may consider blocking this person and/or reporting abuse
Nice article.
Another clean "solution" I'd like to add is to use
async/await
:This ^
And' it supported by major browser now. :D
caniuse.com/#feat=async-functions
The poly-fills for async/await can cost a lot of kb depending on how it's transpiled and chunked.
So keep that in mind if speed and legacy is a factor.
Thanks for the addition! 😎
When there is no way to avoid callback style functions, named functions can help ease the pain.
Also, if you are using node you can use the promisify utility to convert those to promise based functions.
Definitely! Love some bluebird and util. Thanks for commenting Heiker!
Great article! We can condense that even further (no need to write the arguments here)
Becomes
That's just genius 😂
One thing worth noting regarding the shortform though, is that
actually becomes something along the lines of
rather than
which might come with unintended side effects to function scoping and what
this
actually points to.Nice catch!
Awesome post, Amber! Loved the parallelism with Stranger Things... :D
Thanks Paul!
Promises are outdated now, should check with async/await :)
you should write a post about it then
I would but that too is an old story.