developit / developit/preact-virtual-list
Instead of a data prop, allow for an item getter function
- Lenguaje dominante
- JavaScript
- Estrellas
- 231
- Forks
- 24
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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!
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza leyendo el componente de lista virtual y su prop data actual para entender cómo entran las filas en la listview. Evalúa cómo interactuaría una función getRow(index) que devuelve una Promise con el renderizado de las filas visibles, la reutilización del backing store y una caché LRU. La tarea estará terminada cuando los conjuntos de datos grandes puedan cargar filas bajo demanda sin mantener todas las filas en memoria, y el comportamiento esté cubierto por las pruebas existentes del proyecto.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript
- Área
- frontend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100