lukeraymonddowning / infinite_scrolling_in_inertia_js

3 stars 6 forks source link

For data-heavy pages, unmount some data from the DOM as you scroll away from it #8

Open connecteev opened 1 year ago

connecteev commented 1 year ago

This one would be nice-to-have as an example. Per the thread here https://laracasts.com/series/infinite-scrolling-in-inertia/episodes/4?reply=24047 For sites with a lot of data it might be necessary to unmount some data from the DOM as you scroll away from it (or if it were loaded from a live feed like Twitter) so you don't overwhelm the browser.

Perhaps this "page # for unmounting data" could be a parameter or config option in the composable that gets passed in. After that page is reached, the data that is far away from the current scroll position gets unmounted.