I’d like to create a comment section. A real-time listener doesn’t work with pagination in a dynamic collection like that since the moment comments are deleted or added the start value changes for each listener resulting in an inconsistent state.
A solution is to implement pagination using one-time get calls but that forces me to implement my own caching or state management solution to update the local data on the user’s device when they make changes (e.g add, delete, or like a comment). It’s a shame because Firestore implements its own caching solution and listening to the local cache would update fetched data with the user’s updates automatically.
Is there a way easily do it in Firestore?
Please allow me to better understand your case. In my opinion, it makes sense to attach a Firestore listener (snapshot read) to each of topic, but you might not want to attach one listener to every comment.