MCPcopy Create free account
hub / github.com/angular/angular / onAbort

Function onAbort

packages/core/rxjs-interop/src/rx_resource.ts:95–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93 // Track the abort listener so it can be removed if the Observable completes (as a memory
94 // optimization).
95 const onAbort = () => {
96 aborted = true;
97 sub?.unsubscribe();
98 // Remove the listener immediately since unsubscribe won't trigger the subscription's
99 // error/complete handlers. This ensures the promise resolves and PendingTask is released.
100 params.abortSignal.removeEventListener('abort', onAbort);
101 // Resolve the promise with the current stream state if it hasn't been resolved yet.
102 // This ensures the PendingTask created for this request is released.
103 resolveOnce();
104 };
105 params.abortSignal.addEventListener('abort', onAbort);
106
107 function send(value: ResourceStreamItem<T>): void {

Callers

nothing calls this directly

Calls 3

resolveOnceFunction · 0.85
unsubscribeMethod · 0.65
removeEventListenerMethod · 0.65

Tested by

no test coverage detected