# LiveDataSource (@salmonui/data/stream)

> The LiveDataSource interface of @salmonui/data/stream.

Canonical: https://salmonui.dev/docs/reference/data/stream/LiveDataSource

```ts
import type { LiveDataSource } from '@salmonui/data/stream';
```

Also exported from `@salmonui/data`.

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

## Reference

Kind: interface

```ts
interface LiveDataSource<Row> extends DataSource<Row> {
    readonly mode: 'live';
    read(request: DataSourceRequest): Promise<DataSourceResult<Row>>;
    subscribe(listener: (event: DataSourceEvent<Row>) => void): () => void;
    getRows(): readonly Row[];
    close(): void;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `mode` | `readonly mode: 'live';` |  |  |
| `read` | `read(request: DataSourceRequest): Promise<DataSourceResult<Row>>;` |  |  |
| `subscribe` | `subscribe(listener: (event: DataSourceEvent<Row>) => void): () => void;` |  |  |
| `getRows` | `getRows(): readonly Row[];` |  |  |
| `close` | `close(): void;` |  | Closes the stream. |
| `write` | `write?: ((request: WriteRequest<Row>) => Promise<WriteResult<Row>>);` | optional, inherited |  |
| `capabilities` | `capabilities?: Partial<DataSourceCapabilities>;` | optional, inherited |  |
