Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit 37ed0d2

Browse files
timblakelymyspivey
authored andcommitted
fix(afs/typings): valueChanges should return Observable<T|null> (angular#1321)
1 parent 60b454e commit 37ed0d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/firestore/document/document.ts

Lines changed: 2 additions & 2 deletions
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)