watchQuery method

  1. @override
Stream<List<CloudDocument>> watchQuery(
  1. String collection,
  2. CloudQuery query
)
override

query's documents, now and on every change.

Implementation

@override
Stream<List<CloudDocument>> watchQuery(String collection, CloudQuery query) => Stream.fromFuture(_query(collection, query))
    .asyncExpand((q) => q.snapshots())
    .map((snapshot) {
      onRead?.call('watchQuery');
      return _docs(snapshot);
    })
    .handleError((Object error, StackTrace stack) => Error.throwWithStackTrace(_error(error), stack));