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

Function onSignalAbort

lib/internal/streams/iter/utils.js:64–70  ·  view source on GitHub ↗

* Register a handler for an AbortSignal, handling the already-aborted case. * If the signal is already aborted, calls handler immediately. * Otherwise, adds a one-time 'abort' listener. * @param {AbortSignal} signal * @param {Function} handler

(signal, handler)

Source from the content-addressed store, hash-verified

62 * @param {Function} handler
63 */
64function onSignalAbort(signal, handler) {
65 if (signal.aborted) {
66 handler();
67 } else {
68 signal.addEventListener('abort', handler, { __proto__: null, once: true });
69 }
70}
71
72/**
73 * Compute the minimum cursor across a set of consumers and count how many

Callers 3

onShareCancelFunction · 0.85
onBroadcastCancelFunction · 0.85
constructorMethod · 0.85

Calls 2

addEventListenerMethod · 0.65
handlerFunction · 0.50

Tested by

no test coverage detected