watchCount method

  1. @override
Stream<int>? watchCount({
  1. DatumQuery? query,
  2. String? userId,
})
override

Watch the total count of entities, optionally matching a query. Return null if the adapter does not support this feature.

Implementation

@override
Stream<int>? watchCount({DatumQuery? query, String? userId}) {
  return _watch(() async => query != null ? (await this.query(query, userId: userId)).length : (await readAll(userId: userId)).length, userId: userId);
}