toSnapshots method

Stream<Snapshot> toSnapshots({
  1. SnapshotDecoder? decoder,
})

Transforms this stream to a stream of Snapshots with the specified decoder.

The emitted snapshots share their cache for content parts that did not change. Only distinct snapshots are emitted.

Implementation

Stream<Snapshot> toSnapshots({SnapshotDecoder? decoder}) {
  var s = Snapshot.empty(decoder: decoder);
  return map((v) => s = s.set(v)).distinct();
}