I have a use case where backend pagination is not necessary or desirable (the collection will have at most a few hundred items and I would rather load them all upfront and let the users navigate thepagination faster). I want to provide users the option to select the number of items displayed per page, using a dropdown selector.
Everything I could find about custom pagination had to do with backend pagination. How would I achieve this in the frontend?
You can use the slice method say they want to view 10 do slice(array, 10page, 10page +10) where page is a variable of what pagination there on each time they click next +1 previous -1.
I did manage this with the slice approach by the way, but I really feel I was previously able to achieve the same thing much more easily with a more “off-the-shelf” approach. Or maybe I’m misremembering, idk!