How to use .catch(err) on .loadMore()?

Hi,

I have an element which, if it’s in the viewport, executes .loadMore() on my dataset. But when the end of the dataset is reached, it doesn’t provide any actual feedback. It just shows that it’s loading. Is there a way to do .catch(error) or something and then hide the “Loading more” text?

Hey,

You can use wix-dataset API to check whether there are elements left to display. If not, you can hide() the text.

hasNext( ) - Indicates if there is a next item.
hasNextPage( ) - Indicates if there is a next page of data.