perf: improve initial virtual list render speed by calculating height once

This commit is contained in:
James Xylight committed 2025-07-12 11:35:50 -07:00
1 parent c969a32767
commit 3cd4864748
4 files changed
+57 -29

No files matched your search

@@ -50,6 +50,7 @@
let hasMore = $state(true)
async function loadMore() {
console.log(hasMore, loading)
if (!hasMore || loading) return
try {
@@ -255,7 +256,14 @@
</EndPlaceholder>
</div>
{/if}
<InfiniteScroll window threshold={1000} on:loadMore={loadMore} />
<InfiniteScroll
window
threshold={600}
on:loadMore={() => {
console.log('loadMore triggered')
loadMore()
}}
/>
{/if}
{@render children?.()}
</ul>