syncAndListenFrom method

Future syncAndListenFrom(
  1. Stream<Map<K, V>> stream, {
  2. FutureOr<Map<K, V>?>? start,
})

Implementation

Future syncAndListenFrom(Stream<Map<K, V>> stream, {final FutureOr<Map<K, V>?>? start}) async {
  Stream<Map<K, V>> _stream = stream;
  if (start != null) {
    final _start = await start;
    if (_start != null) {
      await this.sync(_start);
    }
  }
  this.subscribedTo = _stream.asyncMap((replacement) {
    return this.sync(replacement);
  }).listen((_) {}, cancelOnError: false);
}