MCPcopy Create free account
hub / github.com/bvaughn/react-virtualized / mergeCellPositions

Function mergeCellPositions

lib/utils/createInnerGridRef.ts:18–27  ·  view source on GitHub ↗
(
  prev: CellPosition | null,
  next: CellPosition
)

Source from the content-addressed store, hash-verified

16
17// Merges two cell positions into the one that covers both (i.e. the smallest indices)
18const mergeCellPositions = (
19 prev: CellPosition | null,
20 next: CellPosition
21): CellPosition =>
22 prev === null
23 ? next
24 : {
25 columnIndex: Math.min(prev.columnIndex, next.columnIndex),
26 rowIndex: Math.min(prev.rowIndex, next.rowIndex)
27 };
28
29/**
30 * Tracks the inner Grid of a component that wraps one (e.g. List or Table, whose handles delegate to the Grid).

Callers 2

recomputeGridSizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected