Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Wait.for: Sequential programming for Node.js (beta). Parent comment
- wait.for it's simpler
- wait.for uses try/catch
I don't know async.series deeply, but, ¿how do you use results from the first function on the second or third?
wait.for:
try{ data = wait.for(function1); result = wait.for(function2, data); } catch(err){ // error handling };
async.series([ function1, function2 ], // optional callback function(err, results){ // results is now equal to ['one', 'two'] });
Example:
results = wait.for(async.map,['file1','file2','file3'], fs.stat);
waterfall
async.waterfall([ function (cb) { . . . cb(stuff); }, function (stuff, cb) { . . .
- wait.for it's simpler
- wait.for uses try/catch
I don't know async.series deeply, but, ¿how do you use results from the first function on the second or third?
wait.for:
async.series: async has a lot of functionality. You can use wait.for and async at the same time. They supply different functionality.Example: