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

TxStore.

Store contract for loading and optional key resolution and writes.

Member / type / returnMeaning
FutureOr<TxLoadResult<T>> load(TxLoadOptions<T> options)Loads using the supplied options; DataSource uses current query state without arguments. Errors propagate.
bool get canInsertWhether the store supports Insert.
bool get canUpdateWhether the store supports Update.
bool get canRemoveWhether the store supports Remove.
bool get canByKeyWhether the store supports ByKey.
FutureOr<T?> byKey(Object key)Reads a record by key; missing keys return undefined (Vue) or null (Dart).
FutureOr<T> insert(T item)Inserts a record with a unique key and returns it.
FutureOr<T> update(Object key, T Function(T) change)Updates a notification or record.
FutureOr<void> remove(Object key)Removes the record or recursively removes a file/directory tree.
dart
import 'package:tecexpress/tecexpress.dart';

Future<void> example() async {
  TxStore<int> store = TxArrayStore([1, 2], keyOf: (v) => v);
  print(await store.load(const TxLoadOptions()));
}