Sunday, July 15, 2012

async map

Recently I've been amazed by the flexibility gained when using jquery's deferred object.  So I'm using it whenever I have the chance :)

As an example, here is an asynchronous version of the good ol' map.

Several improvements are left as exercise to the reader: accept non-deferred objects; sort the final response so that it matches the input's order, etc.

No comments:

Post a Comment