mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Node linking added
This commit is contained in:
16
client/app/scripts/utils/async-utils.js
Normal file
16
client/app/scripts/utils/async-utils.js
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user