EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 444 forks source link

Feature Request: support listening to changes in Firestore #641

Open abhayastudios opened 6 years ago

abhayastudios commented 6 years ago

Hey Eddy!

From what I understand, Firestore supports listening to changes between snapshots. I tried to add the necessary typings based on this piece and this piece from the Firestore typings.

The problem is that even though the typings seem to be fine now, still I get a JS error that snapshot.docChanges is undefined.

Any idea why this is? Maybe the version of Firebase used in the plugin doesn't support it yet?

abhayastudios commented 6 years ago

Also it would be nice to have access to snapshot metadata, for example to check whether we are looking at a cached copy or fresh data from the server as explained here.

GoodLadCarlos commented 6 years ago

We are waiting for an update for the snapshot.metadata to become available. It would be a really great feature.

acrollet commented 5 years ago

I've created a PR at https://github.com/EddyVerbruggen/nativescript-plugin-firebase/pull/1154 that allows getting query snapshot metadata. I don't think it meets all the needs here but it could be something to build on...