How to kill a function ?

Hi !

I’ve set the dataset on my dynamic pages to automaticly loads upon reaching the bottom of the page, and I would like to add a ‘back to the top’ and a ‘show footer’ button on this page.

So how can I kill the ‘infinite loader’ function when the user clicks on the ‘show footer’ button ?

Here is the current code (attached to a line placed under the repeater)

//automaticly loads more items upon reaching the bottom of the page
export function line12_viewportEnter(event, $w) {
	$w("#dynamicDataset").loadMore()
      .then( () => {
      console.log("Done loading more data");
    });
}

Thanks !

bump