Re:Ask HN: Is callback hell exaggerated?
by sleazebreeze on Thursday July 21, 2016 @01:26AM
(#12134932)
That looks like a very similar pattern that I've seen commonly used in Go. It makes for very clear code and explicit error handling. I kind of like it for the clarity, even if it isn't "elegant" or concise.
Did you mean return callback("error1") etc? Forgetting the return is a classic bug when you're in callback hell...
I mean if I didn't have the option of using promises, I would have probably written something like this.
function handler(callback){