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

Function makeHook

benchmark/cases/sync-waterfall-hook/index.bench.mjs:15–22  ·  view source on GitHub ↗
(numTaps, returning)

Source from the content-addressed store, hash-verified

13const { SyncWaterfallHook } = tapable;
14
15function makeHook(numTaps, returning) {
16 const hook = new SyncWaterfallHook(["value"]);
17 for (let i = 0; i < numTaps; i++) {
18 hook.tap(`plugin-${i}`, returning ? (v) => v + 1 : () => undefined);
19 }
20 hook.call(0);
21 return hook;
22}
23
24const INNER_ITERATIONS = 1500;
25

Callers 1

registerFunction · 0.70

Calls 1

tapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…