developit / developit/preact-virtual-list
Instead of a data prop, allow for an item getter function
- 主要言語
- JavaScript
- スター
- 231
- フォーク
- 24
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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!
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
まず仮想リストコンポーネントと現在の data prop を読んで、行がどのように listview に入るのかを理解します。Promise を返す getRow(index) 関数が、表示行のレンダリング、backing store の再利用、LRU キャッシュとどのように相互作用するかを評価します。大規模なデータセットで、すべての行をメモリに保持せずに必要に応じて行を読み込めるようになり、その動作がプロジェクトの既存テストでカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- frontend
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100