isRowLoaded property used by InfiniteLoader to detect which rows was already requested, to avoid multiple call loadMoreRows. So it should be called isRowRequested?
Example in ifiniteloader documentation pretty confused https://github.com/bvaughn/react-virtualized/blob/master/docs/InfiniteLoader.md#examples
function isRowLoaded ({ index }) {
return !!list[index];
}
function loadMoreRows ({ startIndex, stopIndex }) {
return fetch(`path/to/api?startIndex=${startIndex}&stopIndex=${stopIndex}`)
.then(response => {
// Store response data in list...
})
}
It looks like you need just "Store response data in list..." but if you'll do like that you will get the issue with multiple calls of LoadMoreRows because of response delay.
But in the code example this point is pretty clear https://github.com/bvaughn/react-virtualized/blob/master/source/InfiniteLoader/InfiniteLoader.example.js#L111
It took me a long time before I discovered the problem, maybe I have a problem understanding, but mentioning these points would help me a lot and save time.
Thank You.
PRs to the documentation are always welcome if you have suggestions for improving it. 馃槃
I don't think renaming the property is worth the churn it would introduce given that it would be a backwards incompatible change. Maybe something worth considering for version 10.
thanks for pointing out it @VladimirPal , i'm confusing about why loadMoreRows called multiple with overlapped range
isRowLoadingOrLoaded or shouldRequestRow are the only 100% clear names for the property, since the user code may later decide to unload rows if the user scrolls too far (and should -- loading rows until the browser runs out of memory is not responsible programming).
isRowRequested is too vague about the difference between a) if the row has ever been requested, but was later unloaded, and b) the row is actually currently loading or loaded.
+1 for shouldRequestRow
isRowLoadingOrLoaded looks pretty suitable
Most helpful comment
thanks for pointing out it @VladimirPal , i'm confusing about why
loadMoreRowscalled multiple with overlapped range