【发布时间】:2016-04-04 18:54:58
【问题描述】:
所有 async.js 操作符似乎都只用于集合。有没有办法运行这段代码:
async.series([
function (callback) {
TripDao.getTrip(callback);
}],
function done(error, result) {
var trip = result[0];
// things to do with trip
}
);
这样?
async.runSingle(function(callback){
TripDao.getTrip(callback);
},
function done(error, trip){
// things to do with trip
}
);
【问题讨论】: