0

How can I reinitialize IAS or destroy on V3? (no jquery, I am using import InfiniteAjaxScroll from '@webcreate/infinite-ajax-scroll';)

There's also no reinitialize or destroy on their doc (https://docs.v3.infiniteajaxscroll.com/reference/methods)

Infinite Ajax Scroll version: 3
Browser version: FF Dev 71.0b5 (64-bit)
Operating System: OS Catalina (10.15.1)
ivanasetiawan
  • 879
  • 1
  • 10
  • 26

1 Answers1

0

You can call unbind to remove all event listeners. This should be enough to "destroy" IAS.

Otherwise you can probably overwrite the variable that contains the IAS instance.

Pseudo code example:

// previous instance
var ias = InfiniteAjaxScroll(/* options */);

// destroy
ias = null

// reinitialize
ias = InfiniteAjaxScroll(/* some other options */);
Fieg
  • 3,046
  • 1
  • 16
  • 22