streamQuery method
Streams all changes in the store that match the given filter.
Requests a stream from the server and returns that stream. The stream
will initially report a StoreEvent.reset with all data in the store that
matches filter
and then send other events, as data is modified on the
server in realtime. It will only send events for modified data that
matches filter
as well.
Implementation
Future<Stream<StoreEvent<T>>> streamQuery(Filter filter) async {
final stream = await restApi.stream(
path: _buildPath(),
filter: filter,
);
return stream.transform(StoreEventTransformer(
dataFromJson: dataFromJson,
patchSetFactory: (data) => StorePatchSet(store: this, data: data),
));
}