Infinite scrolling for the newsfeed example


I am trying to find a way to call a JSON api with pagination. I am referring to the newsfeed example:

How do I go about loading more news items when user keep scrolling down?

How do I handle performance when there are thousands of items?

Best regards, soe


Just following up on my question. A few pointers would be much appreciated.

Thanks, soe


This is a difficult question to answer question generally. There are a few different strategies depending on what you are optimizing for.

If there is a lot of data, you’d want to paginate at the REST API level, so that you don’t fetch enormous amounts of data over the wire before you need it. For this to happen you’d have to be able to control what data you fetch with arguments to the REST API.

Using a “load more” button is the easiest way to do pagination.

For more fancy automatic loading this would be a bit to complex for me to give an example of here, but Fuse’s internal examples team will produce an example of how to do this eventually.

If you look at how its done with social media apps with their feeds its often done like if you scroll fast you need an event when you have reached the bottom of the feed so you could add a spinner while fetching. Next if you scroll slowly you detect how much you have left to scroll when the finger has left the display and decide to load more data or not.

Thanks for ideas guys.

Looking forward to a tutorial on it in line of UICollectionView in iOS and RecyclerView in Android.

Still no word on this?

There you go: