Lately I've started dabbling in node.js development. I am developing a rest service api for a windows phone 8 application. Soon enough I noticed that my request handlers have too many nested callbacks.
My requirements were that it must be easy to pass the result of one function to the next one, no weird wrapping functions in other functions return deferreds and promises and whatever.
After googling around a bit, i found a few async libraries built for javascript like caolan/async, q and many others. I couldn't wrap my head around how they work, i couldn't find any real life eamples only useless tutorial examples.
So after a while i decide to use https://github.com/caolan/async#waterfall. Why? You can use any function with it, it is easy to pass the results to the next function and no wrapping non-promise functions. And I've been already using it's array manipulation functions already.
So what did it bring me? A few examples...
Your new post is loading...