bvaughn / react-window

React components for efficiently rendering large lists and tabular data
https://react-window.now.sh/
MIT License
15.48k stars 778 forks source link

Should `isItemLoaded` return `true` for in-progress items? #765

Open WofWca opened 4 weeks ago

WofWca commented 4 weeks ago

i.e. for items that are currently being loaded (while the loadMoreItems promise is pending).

The docs seem to be written in a way that suggests that no, https://github.com/bvaughn/react-window-infinite-loader/blob/56720a7b813924a4c3dd10583d26744c96901c30/README.md?plain=1#L81-L98

but the code doesn't seem to remember whether it has started to load particular items https://github.com/bvaughn/react-window-infinite-loader/blob/56720a7b813924a4c3dd10583d26744c96901c30/src/InfiniteLoader.js#L107-L178

I did some testing, and for me it didn't look like items were loaded twice, though perhaps it's just because the promise resolves too fast for me. But for slower promises, we might request items twice I suppose, which is a little inefficient?

Related: #630