3 ms·
Why can't the number of rows loaded be stored in the URL? You could use hx-push-url [1] every time the scroll triggers loading more rows, updating the total nu
by rmbyrro 2y ago
Why can't the number of rows loaded be stored in the URL?
You could use hx-push-url [1] every time the scroll triggers loading more rows, updating the total number of rows loaded. When the browser refreshes the page, the backend will know how many rows to return. No need for complicated JS plugins and service workers. Just basic browser feature, HTTP and HTML. You have fewer ways of shooting your own foot.
I think the modern frontend environment have a tendency to look for over complicated solutions.
Most times I see people proposing JS to manipulate the browser, a simpler browser-based solution would be perfectly good.
In most cases when I browse the web, the JS manipulation leads to very poor UX.
Even when the developer is exceptionally good and can deliver better solution than the browser, the advantage gain is so small that it's not worth the effort. Unless you're Facebook and can dillute the high-quality development cost to billions of users.
[1] https://htmx.org/attributes/hx-push-url/ https://htmx.org/attributes/hx-push-url/