MCPcopy Create free account
hub / github.com/caseywebdev/react-list / updateUniformFrame

Method updateUniformFrame

src/react-list.js:377–391  ·  view source on GitHub ↗
(cb)

Source from the content-addressed store, hash-verified

375 }
376
377 updateUniformFrame(cb) {
378 const { itemSize, itemsPerRow } = this.getItemSizeAndItemsPerRow();
379
380 if (!itemSize || !itemsPerRow) return cb();
381
382 const { start, end } = this.getStartAndEnd();
383
384 const { from, size } = constrain(this.props, {
385 from: Math.floor(start / itemSize) * itemsPerRow,
386 size: (Math.ceil((end - start) / itemSize) + 1) * itemsPerRow,
387 itemsPerRow
388 });
389
390 return this.maybeSetState({ itemsPerRow, from, itemSize, size }, cb);
391 }
392
393 getSpaceBefore(index, cache = {}) {
394 if (cache[index] != null) return cache[index];

Callers 3

updateFrameMethod · 0.95
react-list.jsFile · 0.80
index.jsFile · 0.80

Calls 4

getStartAndEndMethod · 0.95
maybeSetStateMethod · 0.95
constrainFunction · 0.70

Tested by

no test coverage detected