DistinctValueConnectableStream<T> constructor

DistinctValueConnectableStream<T>(
  1. Stream<T> source,
  2. T seedValue, {
  3. bool equals(
    1. T previous,
    2. T next
    )?,
  4. bool sync = true,
})

Constructs a Stream which only begins emitting events when the connect method is called, this Stream acts like a ValueSubject and distinct until changed.

Data events are skipped if they are equal to the previous data event. Equality is determined by the provided equals method. If that is omitted, the '==' operator on the last provided data element is used.

Implementation

factory DistinctValueConnectableStream(
  Stream<T> source,
  T seedValue, {
  bool Function(T previous, T next)? equals,
  bool sync = true,
}) =>
    _DistinctValueConnectableStream<T>._(
      source,
      DistinctValueSubject(seedValue, sync: sync, equals: equals),
      equals,
    );