You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Essentially here is what is happening: db.collection<Location>('locations').doc('someid').valueChanges(); // Returns Observable<unknown> db.collection<Location>('locations').doc<Location>('someid').valueChanges(); // Returns Observable<Location>
Ideally, I think this would be more desirable result since type passed to collection call would pass down to doc call: db.collection<Location>('locations').doc('someid').valueChanges(); // Returns Observable<Location> db.collection<Location>('locations').doc<Location>('someid').valueChanges(); // Returns Observable<Location>
If I am not mistaken, updating the code to following will produce more desirable result (IMHO), and provide fallback if any projects out there had different type in collection and doc calls.
Related issues: #1254
PR that resolved the issue: #1286
P.S. Pardon formatting. I do not contribute enough, or at all, to know the proper code of conduct, but figured this issue might still be considered for a fix.
The text was updated successfully, but these errors were encountered:
I think the following line that specifies
doc
return type should be updated as it is shadowed from Line 41.angularfire/src/firestore/collection/collection.ts
Line 144 in e4400e0
Essentially here is what is happening:
db.collection<Location>('locations').doc('someid').valueChanges(); // Returns Observable<unknown>
db.collection<Location>('locations').doc<Location>('someid').valueChanges(); // Returns Observable<Location>
Ideally, I think this would be more desirable result since type passed to
collection
call would pass down todoc
call:db.collection<Location>('locations').doc('someid').valueChanges(); // Returns Observable<Location>
db.collection<Location>('locations').doc<Location>('someid').valueChanges(); // Returns Observable<Location>
If I am not mistaken, updating the code to following will produce more desirable result (IMHO), and provide fallback if any projects out there had different type in
collection
anddoc
calls.doc<T2 = T>(path?: string): AngularFirestoreDocument<T2> {
return new AngularFirestoreDocument<T2>(this.ref.doc(path), this.afs);
}
Related issues: #1254
PR that resolved the issue: #1286
P.S. Pardon formatting. I do not contribute enough, or at all, to know the proper code of conduct, but figured this issue might still be considered for a fix.
The text was updated successfully, but these errors were encountered: