jonasgeiler / svelte-infinite-loading

An infinite scroll component for Svelte, to help you implement an infinite scroll list more easily.
MIT License
304 stars 11 forks source link

Masonry - Is there a hook or callback I can use to re-fire masonry when new elements loaded? #7

Closed nimmolo closed 9 months ago

nimmolo commented 3 years ago

Hi Skayo, thanks for this library! :) I'm trying svelte-infinite-loading and tiny-virtual-list out, on a grid of Bootstrap column elements (flex columns, not CSS Grid, because i need to support more browsers).

I'd like to apply masonryjs to the elements and re-fire it when new elements are loaded. It seems like virtual list might provide an event to listen to, but I don't find it.

Or should I fire it on my own fetchMore for next page of data? It seems like there might be timing issues with that.

jonasgeiler commented 3 years ago

I'd re-fire it in your fetchData method, as you've said, but only after the tick() promise resolves. This way there won't be any timing issues.

More on tick()

Let me know if it worked!

jonasgeiler commented 9 months ago

Closing this due to inactivity. Let me know if you need any more help!

nimmolo commented 9 months ago

Thanks Jonas... I put that project on hold, sorry I didn't get back to you!