【发布时间】:2014-11-22 08:14:36
【问题描述】:
我使用async.applyEachSeries 让这个 sn-p 工作正常。
var async = require("async");
function firstThing(state, next) {
state.firstThingDone = true;
setImmediate(next);
}
function secondThing(state, next) {
state.secondThingDone = true;
setImmediate(next);
}
var state = {};
async.applyEachSeries([
firstThing,
secondThing
], state, function (error) {
console.log(error, state);
});
我已经多次尝试将其转换为 highland.js,但我并没有摸索那里的管道。我很确定我需要为 firstThing 和 secondThing 做 _.wrapCallback(firstThing) 但不确定我是否需要 _.pipeline 或 .series() 或什么。
【问题讨论】:
标签: async.js highland.js