Node linking added

This commit is contained in:
jpellizzari
2017-01-16 15:25:20 -08:00
parent dea2612611
commit 443941e1b8
8 changed files with 64 additions and 52 deletions

View File

@@ -0,0 +1,16 @@
export function waterfall(series, target, cb) {
function next(result) {
const fn = series.shift();
if (fn) {
try {
fn(result, next);
} catch (e) {
cb(e);
}
} else {
cb(null, result);
}
}
next(target, next);
}