MCPcopy Index your code
hub / github.com/angular/angular / firstValueFrom

Function firstValueFrom

packages/router/src/utils/first_value_from.ts:13–20  ·  view source on GitHub ↗
(source: Observable<T>)

Source from the content-addressed store, hash-verified

11
12/** replacement for firstValueFrom in rxjs 7. We must support rxjs v6 so we cannot use it */
13export function firstValueFrom<T>(source: Observable<T>): Promise<T> {
14 return new Promise<T>((resolve, reject) => {
15 source.pipe(first()).subscribe({
16 next: (value) => resolve(value),
17 error: (err) => reject(err),
18 });
19 });
20}

Callers 13

getChildConfigMethod · 0.90
getRedirectResultFunction · 0.90
wrapIntoPromiseFunction · 0.90
commonTestsFunction · 0.85
applicationRefIsStableFunction · 0.85
whenStableFunction · 0.85

Calls 4

firstFunction · 0.85
rejectFunction · 0.85
subscribeMethod · 0.65
resolveFunction · 0.50

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…