watchById method

Stream<T?> watchById(
  1. int id
)

Stream of a single entity by id; emits whenever it changes.

Implementation

Stream<T?> watchById(int id) => _collection
    .watchWithFinder(Finder(filter: Filter.byKey(id)))
    .map((maps) => maps.isEmpty ? null : mapFromMaps(maps).first);