Skip to content

Home > @liquidrazor/list-display > DataSource

DataSource interface

Generic, technology-agnostic data source contract. Wraps parent-provided data, streams, queries etc.

Signature:

typescript
export interface DataSource<TRow = any, TRowId = RowId>

Properties

Property

Modifiers

Type

Description

destroy?

() => void

(Optional) Optional cleanup hook (unsubscribe, close sockets, etc.).

init

() => Promise<DataSourceInitResult<TRow>>

Initial load. Must resolve with at least the initial rows.

meta

DataSourceMeta

refresh?

() => Promise<void> | void

(Optional) Optional refresh hook (refetch / reload).

subscribe?

(listener: DataPatchListener<TRow, TRowId>) => Unsubscribe

(Optional) Optional stream of patches for incremental updates.