firebase firestore subscription example?
Is there a way to use react-query to listen to firestore subscription?
2 Replies
deep-jade•2y ago
I think this is not a good combination. Query has its own invalidation patterns and does not require a subscription.
You can put anything into query that yields a promise, so I guess the getSnapshot might be a solution for you. But this does not listen for changes.
deep-jade•2y ago
Nonetheless, here is a great article for you: https://tkdodo.eu/blog/using-web-sockets-with-react-query
Using WebSockets with React Query
A step-by-step guide on how to make real-time notifications work with react-query