MCPcopy
hub / github.com/webpack/tapable / runBatch

Function runBatch

benchmark/cases/async-parallel-hook/index.bench.mjs:30–41  ·  view source on GitHub ↗
(hook)

Source from the content-addressed store, hash-verified

28const INNER_ITERATIONS = 200;
29
30function runBatch(hook) {
31 return new Promise((resolve, reject) => {
32 let remaining = INNER_ITERATIONS;
33 const done = (err) => {
34 if (err) return reject(err);
35 if (--remaining === 0) return resolve();
36 };
37 for (let i = 0; i < INNER_ITERATIONS; i++) {
38 hook.callAsync(1, done);
39 }
40 });
41}
42
43/**
44 * @param {import('tinybench').Bench} bench

Callers 1

registerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…