vuejs/vuefire

Support for SnapshotOptions

robokozo opened this issue · 2 comments

What problem is this solving

When $binding to a query that contains serverTimestamp() the timestamp property will return null as described here: firebase/firebase-js-sdk#1929 (comment)

The solution suggested in the post is to include https://firebase.google.com/docs/reference/js/firebase.firestore.SnapshotOptions.html

Which can be applied to the .get({ serverTimestamps: "previous" }) or the .data({ serverTimestamps: "estimate" }) on the snapshot.

Proposed solution

Allow the user to pass down the snapshotOptions when setting up a $bind

Describe alternatives you've considered

Add additional logic around the code that consumes the data to expect the first response to include null

Has any progress been made on this? It seems like a fairly easy feature to add. It would be really nice to get rid of my v-if="field.created" logic 🙏🏻
I would love to make the change myself and submit a PR but I'm concerned I'd screw something else up in the package... 🙈

posva commented

Implemented in 76d36f5