View as Markdown

API reference: @salmonui/core/data

DataSourceEventtype

import type { DataSourceEvent } from '@salmonui/core/data';
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.