-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Pagination #47
Comments
Hi, Pagination is still on my radar, but haven't found an elegant solution yet that I like. I hope to address this in the following weeks. If you have a definitive solution/API in mind, please share it here. |
I have a proposed api. If a timestamp is required then you can use this type of code:
Then in firestore code something like
|
any update on this feature? |
Unfortunately no. Any PRs in this space are welcome though. |
This is what I'm using:
You define the page size with the limit in the initial query like this:
It seems to work. @IjzerenHein can you see any potential issues? |
I created a PagedCollection class that extends Collection.
ill be the first to admit its not great but i needed it quickly and maybe it can be useful to others.
Firestore paging is, to say the least limited, I could not seem to find a way to page backwards (endAt is not sufficient).
The basic premise is:
keep a list of query objects
nextPage queries.push
prevPage queries.pop.
the limitations are:
queries must be a function ( ref=>ref.where.... )
The code is here
https://stackblitz.com/edit/react-firestore-todo-app-er1x8b?file=PagedCollection.js
The text was updated successfully, but these errors were encountered: