zoltan-nz / library-app

Detailed Ember.js v4.7 tutorial for absolute beginners. https://yoember.com

Home Page:http://library-app.firebaseapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expand the tutorial to cover pagination?

Rup1 opened this issue · comments

commented

Hi, I'm getting started with your tutorial and one thing I really wish was included is pagination of results. There isn't much beginner-friendly material on pagination online so this would be a nice addition to your already-comprehensive tutorial.

Hey @Rup1 Thanks for your comment and suggestion. Yep, you totally right, it would be great if pagination would be there... It would be super simple in Ember.js, however Firebase had some kind of limitation. For proper pagination you need the sum of all available record and I haven't found an efficient solution for getting the number of element of a table. I have to double check now, maybe there is already some support from Firebase side. If you see some good solution for that, don't hesitate to share here. ;) Thanks.

commented

I'm a complete beginner, but if I manage to hack something together I'll share that here for what it's worth :)

In terms of pagination.

Firebase suggestion: https://firebase.google.com/docs/firestore/query-data/query-cursors

It looks to me, it is possible to setup a limit and request a subset of the data. My only concern is that for a great pagination experience it is quite handy to know how big is your database so based on that information the number of pages can be calculated. It is possible to get all the record from Firebase, but of course it is not really efficient. I would say pagination is out of scope at the moment, so I close this request and maybe we revisit it later. Thanks.