streamEntry method

Future<Stream<ValueEvent<T>>> streamEntry(
  1. String key
)

Streams changes of a single entry in the store.

Creates a stream that follows the value of the entry under key. It will initially send ValueEvent.update and then send other events, as the entry is modified on the server in realtime.

Implementation

Future<Stream<ValueEvent<T>>> streamEntry(String key) async {
  final stream = await restApi.stream(
    path: _buildPath(key),
  );
  return stream.transform(StoreValueEventTransformer(
    dataFromJson: dataFromJson,
    patchSetFactory: (data) => StorePatchSet(store: this, data: data),
  ));
}