watchQuery method
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));