setRows

Update multiple contiguous rows in place

Available since @roku-sdk/flex-grid 3.3.0

import { setRows } from "@roku-sdk/flex-grid";
setRows<T>(store: GridStore<T>, startRow: number, rows: T[] | undefined[], outChangedRange?: [number, number]): boolean

Deprecated.

Use FlexGridHandle to update grid data. Will be removed from the public exports in the next major version.

Description

Update multiple contiguous rows in place. Bumps version once for the batch.

Rows whose new value is reference-identical to the current value are skipped (not marked dirty). Returns true if at least one row reference changed, so callers can avoid bumping their reactive store-version signal on a no-op update (e.g. re-pushing an already-present cached row during navigation).

When outChangedRange is supplied it is filled with the inclusive [first, last] row indices that actually changed, letting a caller that needs to re-derive per-row bookkeeping visit only those rows instead of the whole pushed range. It is left untouched when nothing changed (i.e. when the return value is false), so read it only after checking the return value. Passing a reused tuple keeps this allocation-free on the navigation path, which calls this on every focus change.

Parameters

NameTypeDescription
storeGridStore<T>
startRownumber
rowsT[] | undefined[]
outChangedRange?[number, number]

Return values

Returns boolean.


What’s Next

Did this page help you?