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

Commit

Permalink
fix(afs/typings): valueChanges should return Observable<T|null> (angu…
Browse files Browse the repository at this point in the history
  • Loading branch information
timblakely authored and myspivey committed Apr 10, 2018
1 parent 60b454e commit 37ed0d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/firestore/document/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ export class AngularFirestoreDocument<T> {
/**
* Listen to unwrapped snapshot updates from the document.
*/
valueChanges(): Observable<T> {
valueChanges(): Observable<T|null> {
return this.snapshotChanges().map(action => {
return (action.payload.exists ? action.payload.data() : null) as T;
return action.payload.exists ? action.payload.data() as T : null;
});
}
}

0 comments on commit 37ed0d2

Please sign in to comment.