MCPcopy Create free account
hub / github.com/codeaashu/claude-code / propagateAbort

Function propagateAbort

src/utils/abortController.ts:30–36  ·  view source on GitHub ↗

* Propagates abort from a parent to a weakly-referenced child controller. * Both parent and child are weakly held — neither direction creates a * strong reference that could prevent GC. * Module-scope function avoids per-call closure allocation.

(
  this: WeakRef<AbortController>,
  weakChild: WeakRef<AbortController>,
)

Source from the content-addressed store, hash-verified

28 * Module-scope function avoids per-call closure allocation.
29 */
30function propagateAbort(
31 this: WeakRef<AbortController>,
32 weakChild: WeakRef<AbortController>,
33): void {
34 const parent = this.deref()
35 weakChild.deref()?.abort(parent?.signal.reason)
36}
37
38/**
39 * Removes an abort handler from a weakly-referenced parent signal.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected