Store contract for loading and optional key resolution and writes.
interface TxStore<T> {
load(options: TxLoadOptions<T>): Promise<TxLoadResult<T>> | TxLoadResult<T>
byKey?(key: TxKey): Promise<T | undefined> | T | undefined
insert?(item: T): Promise<T> | T
update?(key: TxKey, changes: Partial<T>): Promise<T> | T
remove?(key: TxKey): Promise<void> | void
}| Field | Meaning |
|---|---|
| load | Loads using the supplied options; DataSource uses current query state without arguments. Errors propagate. |
| byKey | Reads a record by key; missing keys return undefined (Vue) or null (Dart). |
| insert | Inserts a record with a unique key and returns it. |
| update | Updates a notification or record. |
| remove | Removes the record or recursively removes a file/directory tree. |
import type { TxStore } from '@tekocloud.de/tecexpress'
const example: TxStore<{ id: number }> = { load: () => ({ data: [{ id: 1 }] }) }
console.log(example)