merge<T> static method

Stream<T> merge<T>(
  1. Iterable<Stream<T>> streams
)

Flattens the items emitted by the given streams into a single Stream sequence.

If the provided streams is empty, the resulting sequence completes immediately without emitting any items.

Interactive marble diagram

Example

Rx.merge([
  Rx.timer(1, Duration(days: 10)),
  Stream.value(2)
])
.listen(print); // prints 2, 1

Implementation

static Stream<T> merge<T>(Iterable<Stream<T>> streams) =>
    MergeStream<T>(streams);