News for hackers. Stuff that matters.
Re:Nimble - a tiny functional js and async flow control library by caolanm on Friday March 18, 2011 @12:09PM (#2340844)
Ok, it took me like 3 attempts to post this link, sorry if I spammed anyone :(
Re:Nimble - a tiny functional js and async flow control library by mkrecny on Friday March 18, 2011 @02:08PM (#2341297)
how does this fit in the scheme of things with regard to your async lib??
Re:Nimble - a tiny functional js and async flow control library by caolanm on Friday March 18, 2011 @03:07PM (#2341538)
The async lib will still be developed, and will aim to be as comprehensive as possible.

This library was created because I often include both async and underscore in client-side projects, which seems a bit overkill when every kb matters.

I've also looked into combining the features of async with underscore in the past. However, I don't believe its possible without backward incompatible changes, or a separate API (one for sync one for async). Nimble is an experiment in how a combined API might work, and uses some interesting tricks regarding function arity to support something closer to the standard map/filter/reduce, while still being convenient to use with callbacks.

For example, you can do the following:

_.map(arr, function (val, callback) { ... }, main_callback);

but you can also do this:

_.map(arr, function (val, key, arr, callback) { ... }, main_callback);

And it will still work as expected.

Re:Nimble - a tiny functional js and async flow control library by mkrecny on Friday March 18, 2011 @03:57PM (#2341712)
thanks - i really like what you've done w/ async so am excited about this too : )