MCPcopy
hub / github.com/bvaughn/react-virtualized / _doStuff

Method _doStuff

source/InfiniteLoader/InfiniteLoader.js:125–150  ·  view source on GitHub ↗
(startIndex, stopIndex)

Source from the content-addressed store, hash-verified

123 }
124
125 _doStuff(startIndex, stopIndex) {
126 const {isRowLoaded, minimumBatchSize, rowCount, threshold} = this.props;
127
128 const unloadedRanges = scanForUnloadedRanges({
129 isRowLoaded,
130 minimumBatchSize,
131 rowCount,
132 startIndex: Math.max(0, startIndex - threshold),
133 stopIndex: Math.min(rowCount - 1, stopIndex + threshold),
134 });
135
136 // For memoize comparison
137 const squashedUnloadedRanges = [].concat(
138 ...unloadedRanges.map(({startIndex, stopIndex}) => [
139 startIndex,
140 stopIndex,
141 ]),
142 );
143
144 this._loadMoreRowsMemoizer({
145 callback: () => {
146 this._loadUnloadedRanges(unloadedRanges);
147 },
148 indices: {squashedUnloadedRanges},
149 });
150 }
151
152 _registerChild(registeredChild) {
153 this._registeredChild = registeredChild;

Callers 2

_onRowsRenderedMethod · 0.95

Calls 2

_loadUnloadedRangesMethod · 0.95
scanForUnloadedRangesFunction · 0.85

Tested by

no test coverage detected