sequenceEqual<A, B> static method

Stream<bool> sequenceEqual<A, B>(
  1. Stream<A> stream,
  2. Stream<B> other, {
  3. bool equals(
    1. A a,
    2. B b
    )?,
  4. bool errorEquals(
    1. ErrorAndStackTrace,
    2. ErrorAndStackTrace
    )?,
})

Determine whether two Streams emit the same sequence of items. You can provide an optional equals handler to determine equality.

Interactive marble diagram

Example

Rx.sequenceEqual([
  Stream.fromIterable([1, 2, 3, 4, 5]),
  Stream.fromIterable([1, 2, 3, 4, 5])
])
.listen(print); // prints true

Implementation

static Stream<bool> sequenceEqual<A, B>(
  Stream<A> stream,
  Stream<B> other, {
  bool Function(A a, B b)? equals,
  bool Function(ErrorAndStackTrace, ErrorAndStackTrace)? errorEquals,
}) =>
    SequenceEqualStream<A, B>(
      stream,
      other,
      dataEquals: equals,
      errorEquals: errorEquals,
    );