# DataSourceEvent (@salmonui/data-grid/engine)

> The DataSourceEvent type of @salmonui/data-grid/engine: Change notification from a data source. rows is always the complete new row array; the id lists let the engine update incrementally.

Canonical: https://salmonui.dev/docs/reference/data-grid/engine/DataSourceEvent

```ts
import type { DataSourceEvent } from '@salmonui/data-grid/engine';
```

Entry index: https://salmonui.dev/docs/reference/data-grid/engine (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid/engine.md).

## Reference

Kind: type

```ts
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.
