How To Attach A Permanent Listener To A Firestore Query?
Solution 1:
It's not possible to simply replace the query for a listener. When you add a listener to a query, it will forever use that query until the listener is removed.
If you want to start getting results for a new query, you will have to repeat the process and add a listener to that new query. You can use the same listener object if you want, but you can't simply "swap in" a new query.
Solution 2:
My advice to pagination is using local database as the layer between your remote data and your app. The idea is, get the data into your database, which you can have absolute control in paginating the data. For example, when you need the data, query your database, if the query doesn't exists, query your firebase, cache the data to your database which will in turn feed your request. That is the flow. If you don't understand you can ask me.
PS: this is just an advice, not an answer to your problem.
Post a Comment for "How To Attach A Permanent Listener To A Firestore Query?"