Open somegooser opened 1 year ago
you can simply delete it:
const countUp = new CountUp('targetId', 5234);
countUp.start();
and later
delete countUp;
Thank you for the comment but will this also delete events attached via enableScrollSpy?
good point. You could do
delete window['onScrollFns'];
window.onscroll = null;
I really don't think you're going to get any performance wins by doing that.
However if you deleted your countUp instance, and it was using scroll spy, you could get a null pointer exception, so I could add a detach method.
This is published in v2.4.2
Is there any way to destory / cleanup countup after use?
Thanks!