t×tecexpressby TeKOcloud
DEv0.7.1
API & types / VUE

TxStore.

Store contract for loading and optional key resolution and writes.

ts
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
}
FieldMeaning
loadLoads using the supplied options; DataSource uses current query state without arguments. Errors propagate.
byKeyReads a record by key; missing keys return undefined (Vue) or null (Dart).
insertInserts a record with a unique key and returns it.
updateUpdates a notification or record.
removeRemoves the record or recursively removes a file/directory tree.
ts
import type { TxStore } from '@tekocloud.de/tecexpress'
const example: TxStore<{ id: number }> = { load: () => ({ data: [{ id: 1 }] }) }
console.log(example)