Ruby on Rails #69 Frames + Streams: Infinite Scroll Pagination (Best approach)

01/04/2022 (about 2 years ago)
·

In the last 2 episodes we implemented Infinite Scroll Pagination with Frames and Streams separately.

In this episode we will combine Frames + Streams to create an event simpler way to add Infinite Scroll to a Rails 7 app with Hotwire.

Episode source code: https://github.com/corsego/69-infinite-pagination-revised/commit/3018c50d1049cc3f9e8bc5bcf2fb1a84609ea7e1

Pagy Countless: https://ddnexus.github.io/pagy/extras/countless.html#gsc.tab=0

Thanks to https://github.com/secretpray/ for showing me this solution!

0:00 Previous approaches
0:50 Scaffold and seed Artists
1:25 Paginate Artists
2:05 Turbo Frame responds to Turbo Stream
5:15 WORKS!
5:30 Stop scrolling if no more pages
6:32 Summary
7:02 Pagy Countless


0
Sign in to join the conversation