MCPcopy
hub / github.com/caolan/async / during

Function during

lib/during.js:41–58  ·  view source on GitHub ↗
(test, fn, callback)

Source from the content-addressed store, hash-verified

39 * );
40 */
41export default function during(test, fn, callback) {
42 callback = onlyOnce(callback || noop);
43 var _fn = wrapAsync(fn);
44 var _test = wrapAsync(test);
45
46 function next(err) {
47 if (err) return callback(err);
48 _test(check);
49 }
50
51 function check(err, truth) {
52 if (err) return callback(err);
53 if (!truth) return callback(null);
54 _fn(next);
55 }
56
57 _test(check);
58}

Callers

nothing calls this directly

Calls 2

onlyOnceFunction · 0.85
wrapAsyncFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…