我需要将一些参数传递给async waterfall()
的初始函数。建议的方法https://github.com/caolan/async/issues/14对我不起作用,因为我需要传递ExpressJS函数的响应
exports.categories = (req, res) ->
async.waterfall [
(callback) ->
# need req here...
答案 0 :(得分:3)
async.waterfall([
async.apply(function(req, callback) {}, req);
]);
答案 1 :(得分:1)
async.waterfall [
( (req, callback) ->
).bind(null, req)
]