我使用async.applyEachSeries
.
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,但我并没有摸索那里的管道。我很确定我需要_.wrapCallback(firstThing)
为 firstThing 和 secondThing 做,但不确定我是否需要_.pipeline
或.series()
什么。