Skip to content

Commit aadc71a

Browse files
timblakelyjamesdaniels
authored andcommitted
fix(afs/typings): valueChanges should return Observable<T|null> (#1321)
1 parent 11b36ad commit aadc71a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/firestore/document/document.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ export class AngularFirestoreDocument<T> {
8989
/**
9090
* Listen to unwrapped snapshot updates from the document.
9191
*/
92-
valueChanges(): Observable<T> {
92+
valueChanges(): Observable<T|null> {
9393
return this.snapshotChanges().map(action => {
94-
return (action.payload.exists ? action.payload.data() : null) as T;
94+
return action.payload.exists ? action.payload.data() as T : null;
9595
});
9696
}
9797
}

0 commit comments

Comments
 (0)