You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just thought how one could easily integrate some paging for a long list like an activity which should ideally not loaded all at once rather incrementally if the user needs to.
And my thought was: Well we could build something ourselves, but then I thought this is a rather repetitive task so I think it would be great to get this behavior in something like FirebaseUI.
The idea is we developer just give a query to Firebase UI and then all the heavy lifting get's take care of,
like checking if how many contents should be loaded initially (maybe there could be an option to help Firebase UI to determine how many should be loaded),
when new content should be loaded due to the scrolling position,
sending out delegate methods when to display a loader or better having a delegate method which returns a UIView which then gets displayed at the right end of the Table/CollectionView as a loader
keeping track of changes to documents and what content to load next
updating the local copy of array when new content gets loaded and so on.
We're making some improvements to FUIArray in this area. This is something we could build into a data source, but for the time being it's something you'll have to build on your own. You can do this by:
Make a query with some base limit (say, 50 elements), and using an FUIArray instance to load the query.
Track the user's scroll position.
When the user is almost at the end of the list, change the query on the FUIArray to the same query with a different limit (say, 100 elements).
The FUIArray will automatically download the new query's contents and diff them for you.
Currently this doesn't scale beyond a hundred or so elements, but we're adding improved support for that in #548.
Any update on this? We need paging support and changing the query limit isn't feasible because, as you mentioned, the query begins getting very large very quickly. There needs to be a way to incorporate the query cursors so that we only have to load the additional elements, not the entire query every time: i.e., instead of first loading 0-49, then 0-99, then 0-149, the proper paging implementation should first load 0-49, then 50-99, then 100-149, etc.. as the user continues scrolling. There should be a method we can call from the UITableViewDataSourcePrefetching delegate method prefetchRowsAt to let FirebaseUI fetch the data ahead of time.
Hey @morganchen12 just wanted to indicate that we'd still appreciate this. We're able to do this manually on our end of course, but as mentioned above this is a pretty common use-case that fits the scope of this library if someone on the team can allocate some dev cycles to it.
Hello, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. If it is still relevant, leave a comment to keep it open.
This issue will be closed in 15 days if no further activity occurs.
Activity
morganchen12 commentedon Oct 22, 2018
We're making some improvements to
FUIArrayin this area. This is something we could build into a data source, but for the time being it's something you'll have to build on your own. You can do this by:FUIArrayinstance to load the query.FUIArrayto the same query with a different limit (say, 100 elements).FUIArraywill automatically download the new query's contents and diff them for you.Currently this doesn't scale beyond a hundred or so elements, but we're adding improved support for that in #548.
willbattel commentedon Jan 4, 2019
Any update on this? We need paging support and changing the query limit isn't feasible because, as you mentioned, the query begins getting very large very quickly. There needs to be a way to incorporate the query cursors so that we only have to load the additional elements, not the entire query every time: i.e., instead of first loading 0-49, then 0-99, then 0-149, the proper paging implementation should first load 0-49, then 50-99, then 100-149, etc.. as the user continues scrolling. There should be a method we can call from the
UITableViewDataSourcePrefetchingdelegate methodprefetchRowsAtto let FirebaseUI fetch the data ahead of time.IchordeDionysos commentedon Mar 3, 2020
@morganchen12 Are there any updates on this?
morganchen12 commentedon Mar 3, 2020
No, unfortunately I haven't started work on this yet.
willbattel commentedon Jul 11, 2021
Hey @morganchen12 just wanted to indicate that we'd still appreciate this. We're able to do this manually on our end of course, but as mentioned above this is a pretty common use-case that fits the scope of this library if someone on the team can allocate some dev cycles to it.
github-actions commentedon Jul 8, 2026
Hello, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. If it is still relevant, leave a comment to keep it open.
Thank you for your contributions.
russellwheatley commentedon Aug 3, 2026
Closing this out due to age. If someone wants to open a PR for it, I'm happy to take a look.