Y
Hacker News
new
|
ask
|
show
|
jobs
by
jj2
4852 days ago
If you have to deal with lots of nested callbacks, it's probably worth to use a CPS transformation like Streamline.js. It makes your code a lot cleaner. As if it was written synchronously.
https://github.com/Sage/streamlinejs
http://en.wikipedia.org/wiki/Continuation-passing_style