I have two functions:
function one(next){ Users.find({}, function(err, docs){ if( err) next( err ); } else { next( null ); } }); } function two(next){ Something.find({}, function(err, docs){ if( err) next( err ); } else { next( null ); } }); }
I can use the asynchronous library:
async.series( [one, two], function( err ){ ... });
Here the callback is called immediately (with a set of errors) if one () returns err. What is a simple, BASIC implementation of async.series? I looked at the async library code (which is fantastic), but it is a library that is designed for a lot of things, and I am having real problems after it.
Can you tell me a simple simple implementation of async.series? Something that it just calls the functions one by one, and - if one of them calls the callback with an error - does it call the final callback with err set?
Thanks...
Merc.
source share