MCPcopy
hub / github.com/angular/angularfire / valueChanges

Function valueChanges

src/compat/database/list/create-reference.ts:31–48  ·  view source on GitHub ↗
(events?: ChildEvent[], options?: {idField?: K})

Source from the content-addressed store, hash-verified

29 return auditTrail<T>(query, events, outsideAngularScheduler).pipe(pendingUntilEvent(injector));
30 },
31 valueChanges<K extends string>(events?: ChildEvent[], options?: {idField?: K}): Observable<(T & Record<string, string>)[]> {
32 const snapshotChanges$ = snapshotChanges<T>(query, events, outsideAngularScheduler);
33 return snapshotChanges$.pipe(
34 map(actions => actions.map(a => {
35 if (options && options.idField) {
36 return {
37 ...a.payload.val() as T,
38 ...{
39 [options.idField]: a.key
40 }
41 };
42 } else {
43 return a.payload.val() as T & Record<string, string>
44 }
45 })),
46 pendingUntilEvent(injector)
47 );
48 }
49 };
50}

Callers

nothing calls this directly

Calls 2

snapshotChangesFunction · 0.90
valMethod · 0.65

Tested by

no test coverage detected