logoalt Hacker News

xigoiyesterday at 9:03 PM4 repliesview on HN

Infinite scroll makes the problem much easier, even if it’s still a problem. The only action you need to support is loading more results, which you can do by loading all results and filtering out those already shown. With pagination, the user may say “give me page 3” and you have no idea what was on pages 1 and 2, if they were even loaded.


Replies

hdgvhicvyesterday at 10:42 PM

If page 1 and 2 were 10 each you load results 21-30

Same as if you are scrolling and have reached result 20 And want to load more.

show 1 reply
bigmadshoetoday at 3:17 AM

Just use cursor based pagination. How is this any different whether it’s infinite scroll or separate pages?

show 2 replies
svachalektoday at 1:03 AM

You can implement pagination exactly the same way. It's a UX decision that has nothing to do with underlying queries, although it typically maps.

The typical infinite scroll that I've seen implemented does not work the way you describe though, it's just pagination without controls. The reason it works is because it's pushing content you never asked for anyway and it just keeps pushing. Without any sense of pages you'll never know the difference.

show 1 reply
malfisttoday at 12:19 AM

I mean sure, if you do it that way. But its easy to encode the page starting index and pagenate from there. Its even exactly the same algorithm as infinite scroll.