redux-firestore icon indicating copy to clipboard operation
redux-firestore copied to clipboard

"type: once" for Firestore

Open optimistiks opened this issue 5 years ago • 2 comments

According to Firestore documentation, https://firebase.google.com/docs/firestore/pricing#listens, when you use onSnapshot, you are charged every time any document in the result set is changed or removed from a result set due to some change.

When using firestoreConnect, there is no way to make sure the data only fetched once, just as we can do with firebaseConnect. It means when you don't need realtime updates, you have to either write a custom data loader instead of using firestoreConnect, or be charged for a lot of unnecessary read operations.

It would be great to have an ability to fetch data once when using firestoreConnect. Maybe something along those lines { storeAs: "foo", once: true }, or something like that.

optimistiks avatar Jun 14 '19 10:06 optimistiks

Noted as a possible feature, thanks for posting! It may end up being something with get since that is the syntax Firestore uses.

For now, folks can use get in componentDidMount

prescottprue avatar Jun 16 '19 15:06 prescottprue

Would love to see this feature as well!

ppotter100 avatar Dec 12 '19 08:12 ppotter100