MCPcopy
hub / github.com/angular/angular / trackEvents

Function trackEvents

packages/common/http/test/fetch_spec.ts:26–37  ·  view source on GitHub ↗
(obs: Observable<any>)

Source from the content-addressed store, hash-verified

24import {FetchBackend, FetchFactory, HTTP_FETCH_MAX_RESPONSE_SIZE} from '../src/fetch';
25
26function trackEvents(obs: Observable<any>): Promise<any[]> {
27 return obs
28 .pipe(
29 // We don't want the promise to fail on HttpErrorResponse
30 catchError((e) => of(e)),
31 scan((acc, event) => {
32 acc.push(event);
33 return acc;
34 }, [] as any[]),
35 )
36 .toPromise() as Promise<any[]>;
37}
38
39const TEST_POST = new HttpRequest('POST', '/test', 'some body', {
40 responseType: 'text',

Callers 1

fetch_spec.tsFile · 0.70

Calls 2

catchErrorFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…