watchFirst method
Watch the first entity matching a query, optionally sorted. Return null if the adapter does not support this feature.
Implementation
@override
Stream<T?>? watchFirst({DatumQuery? query, String? userId}) {
return _watch(() async {
final items = query != null ? await this.query(query, userId: userId) : await readAll(userId: userId);
return items.isEmpty ? null : items.first;
}, userId: userId);
}