MCPcopy Index your code
hub / github.com/nodejs/node / makeUseHook

Function makeUseHook

lib/internal/promise_hooks.js:90–98  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

88}
89
90function makeUseHook(name) {
91 const list = hooks[name];
92 return (hook) => {
93 validatePlainFunction(hook, `${name}Hook`);
94 ArrayPrototypePush(list, hook);
95 update();
96 return FunctionPrototypeBind(stop, null, list, hook);
97 };
98}
99
100const onInit = makeUseHook('init');
101const onBefore = makeUseHook('before');

Callers 1

promise_hooks.jsFile · 0.85

Calls 1

updateFunction · 0.70

Tested by

no test coverage detected