View as Markdown

API reference: @salmonui/data-grid/engine

DataSourceEventtype

import type { DataSourceEvent } from '@salmonui/data-grid/engine';
type DataSourceEvent<Row> = {
    readonly type: 'reset';
    readonly rows: readonly Row[];
    readonly totalRowCount?: number;
} | {
    readonly type: 'patch';
    readonly rows: readonly Row[];
    readonly updated: readonly RowId[];
    readonly added: readonly RowId[];
    readonly removed: readonly RowId[];
    readonly totalRowCount?: number;
};

Change notification from a data source. rows is always the complete new row array; the id lists let the engine update incrementally.