Ask A Question

Notifications

You’re not receiving notifications from this thread.

Intersection Observer API to refactor Infinite scroll Discussion

Hi, Chris!

Recently found gem from basecamp “geared_pagination”. Can you make a suggestion how to integrate it instead of pagy?

Reply

Looks like if scroll too fast the same data is fetched twice, even in the video you can see the same. So basically we should still use this.loading to prevent fetching same data multiple times.

Reply

This works great! The only thing I'd add is that if you want to hide the pagination itself, don't use "display: none" because the observer API won't work.
You can use "opacity:0" or some other way of hiding the div, and it'll work!

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.