Skip to content

@jsvision/datagrid / isWindowed

Function: isWindowed()

isWindowed<T>(source): boolean

Defined in: datagrid/src/windowing.ts:35

Whether a source is windowed — i.e. it drives its own loading through ensureRange, so the grid must take the lazy read path (windowedView) instead of materializing every row. An eager in-memory source (no ensureRange) is not windowed and keeps the dense-array path unchanged.

Type Parameters

T

T

Parameters

source

GridDataSource<T>

The data source to classify.

Returns

boolean

true when the source exposes ensureRange, false otherwise.

Example

ts
import { fromRows, isWindowed } from '@jsvision/datagrid';
import { signal } from '@jsvision/ui';
isWindowed(fromRows(signal([{ id: 1 }]), { rowKey: (r) => r.id })); // false — eager
// A source that implements `ensureRange(start, end)` returns true.