View as Markdown

API reference: @salmonui/data-grid/engine/infinite

InfiniteScrollOptionsinterface

import type { InfiniteScrollOptions } from '@salmonui/data-grid/engine/infinite';
interface InfiniteScrollOptions<Row = unknown> {
    readonly blockSize?: number;
    readonly initialBlocks?: number;
    readonly cache?: boolean;
    readonly maxBlocks?: number;
    readonly threshold?: number;
    readonly debounceMs?: number;
    readonly initialResult?: Pick<DataSourceResult<Row>, 'rows' | 'totalRowCount' | 'pageInfo'>;
    readonly scheduler?: InfiniteScheduler;
}
InfiniteScrollOptions members (8)
NameSignatureDescription
blockSizeoptionalreadonly blockSize?: number;

Rows per block and per request unit. Default 100.

initialBlocksoptionalreadonly initialBlocks?: number;

Blocks of the first request. Default 3.

cacheoptionalreadonly cache?: boolean;

Bound the blocks held in memory to maxBlocks. Default false: every loaded block is kept.

maxBlocksoptionalreadonly maxBlocks?: number;

Blocks kept with cache; never fewer than the viewport needs. Default 3.

thresholdoptionalreadonly threshold?: number;

Rows before the loaded end (and around the viewport) at which the next block is requested. Default half a block.

debounceMsoptionalreadonly debounceMs?: number;

Quiet time before a request for a jump target (scrollbar drag, scrollTo) and between sequential requests. Default 50 ms.

initialResultoptionalreadonly initialResult?: Pick<DataSourceResult<Row>, 'rows' | 'totalRowCount' | 'pageInfo'>;

The first blocks, already fetched (server render): rendered on the server and on the first client render, and not requested again. rows start at row 0.

scheduleroptionalreadonly scheduler?: InfiniteScheduler;

Clock and timers (tests). Default Date.now, setTimeout, clearTimeout.