Open jbixon13 opened 4 years ago
I think it should work if you do this:
$: if (index == 2) {
count();
}
I've opened PR #14 to avoid repeated calls to the function (you could alternatively use another variable to keep track of whether index
has changed from its previous value).
Hello! I was wondering this too. I tried this as well but my function ended up getting called over 100 times and glitching.
@maxgraze here is the version where I tried to fix the issue of repeated function calls: https://github.com/jtrim-ons/svelte-scroller/blob/fewer-section-updates/Scroller.svelte . If you decide to give it a try, let us know if it works.
Is it possible to execute arbitrary functions such as:
This is possible in something like scrollama.js, and I would like to use svelte-scroller to do so if possible as it's already built into Svelte.