fix(firestore): add explicit _apply to QueryConstraint subclasses#8928
fix(firestore): add explicit _apply to QueryConstraint subclasses#8928
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| _apply<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>( | ||
| query: Query<AppModelType, DbModelType>, | ||
| ): Query<AppModelType, DbModelType> { | ||
| return super._apply(query); | ||
| } |
There was a problem hiding this comment.
🤔 I may be missing something, but if this (and StartEnd/EndAt/Limit/FieldFilter also) all extend QueryConstraintBase, and it extends QueryConstraint which declares:
abstract _apply<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>(
query: Query<AppModelType, DbModelType>,
): Query<AppModelType, DbModelType>;...but these implementations are really just duplicating the signature and all calling return super._apply(query) which will chain up to an empty definition....why not make the definition in QueryConstraint concrete (even if empty, just document it's a no-op ?) and then get rid of 5 duplications of the signature with empty methods
Or is there some actual affect happening when you return a call to super._apply even if the inheritance chain seems to lead to an abstract definition?
mikehardy
left a comment
There was a problem hiding this comment.
looks clean + minimal to me at this point, I like it
Mr @russellwheatley ?
Description
closes #8923
Related issues
Release Summary
Checklist
AndroidiOSOther(macOS, web)e2etests added or updated inpackages/\*\*/e2ejesttests added or updated inpackages/\*\*/__tests__Test Plan
Think
react-native-firebaseis great? Please consider supporting the project with any of the below:React Native FirebaseandInvertaseon Twitter