developit / developit/preact-virtual-list

Instead of a data prop, allow for an item getter function

Aperta
#3 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
231
Fork
24
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I implemented something similar to this and if you truly are going to make 1M rows available for scrolling, you definitely don't want them all in memory at the same time.

The way I got around this was to have my component accept a getRow() function that when called with an index returns a Promise. When the promise resolves, the data is then popped into the listview. If the row is already in the backing store, it's easy enough to ship a pre-resolved Promise. You'd use a storage pattern like an LRU to keep overall memory impact low.

Cheers!

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.