API reference: @salmonui/data/local
OfflineDataSourceinterface
import type { OfflineDataSource } from '@salmonui/data/local';Also exported from @salmonui/data.
interface OfflineDataSource<Row> extends DataSource<Row> {
readonly mode: 'local';
read(request: DataSourceRequest): DataSourceResult<Row>;
subscribe(listener: (event: DataSourceEvent<Row>) => void): () => void;
load(): Promise<readonly Row[]>;
readonly status: 'idle' | 'loading' | 'ready' | 'error';
}
| Name | Signature | Description |
|---|---|---|
mode | readonly mode: 'local'; | |
read | read(request: DataSourceRequest): DataSourceResult<Row>; | |
subscribe | subscribe(listener: (event: DataSourceEvent<Row>) => void): () => void; | |
load | load(): Promise<readonly Row[]>; | (Re)loads the set; emits one |
status | readonly status: 'idle' | 'loading' | 'ready' | 'error'; | |
writeoptionalinherited | write?: ((request: WriteRequest<Row>) => Promise<WriteResult<Row>>); | |
capabilitiesoptionalinherited | capabilities?: Partial<DataSourceCapabilities>; |