-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(firestore): Add data converter #8672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(firestore): Add data converter #8672
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bump! |
Bump! |
Have you noticed that CollectionReference only has one type param, but it's passed two? export interface CollectionReference<T extends DocumentData = DocumentData> extends Query<T> { In your method declaration: withConverter<NewAppModelType, NewDbModelType extends DocumentData = DocumentData>(
converter: FirestoreDataConverter<NewAppModelType>,
): CollectionReference<NewAppModelType, NewDbModelType>; It's not just your code, I came across this PR because there's something wrong with these typings already. |
Hey @macksal good catch I didn't notice it but you're right the types in this repo aren't yet inline with the firebase sdk since they are lacking the DbModel type im gonna remove that for now since adding it should be its own PR. Edit: or actually after taking a quick look it may make more sense for me to just add it in now I guess since that type is needed elsewhere. |
Description
I have added the
withConverter
method which is provided in the JS sdk to the package here.Release Summary
withConverter
toCollectionReference
FirestoreDataConverter
Checklist
Android
iOS
Other
(macOS, web)e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter