Is there some framework similar to underscore that allows me to run async methods on collections.
Something like _.each(collection, itemCallback, doneCallback).
For example:
_.each(items, function(item, token){
item.someProperty = null;
}, function(err){
console.log("The loop is done");
});
Edit: async.js actually doesn't solve the problem. For example the following code
<script type="text/javascript" src="async.js"></script>
<script type="text/javascript">
var arr = ["a","b","c"];
async.forEach(arr, function(item, met){
console.log(item);
},
function(err){
});
console.log("Done");
</script>
prints a b c Done
While I want it to print Done a b c
I can do it with underscore deffer but maybe there is some other lib that can do it without wrappers.
asyncmodule. :)