FlatMapExtension<T> extension Null safety

Extends the Stream class with the ability to convert the source Stream into a new Stream each time the source emits an item.

on

Methods

flatMap<S>(Stream<S> mapper(T value), {int? maxConcurrent}) Stream<S>
Converts each emitted item into a Stream using the given mapper function, while limiting the maximum number of concurrent subscriptions to these Streams. The newly created Stream will be be listened to and begin emitting items downstream.
flatMapIterable<S>(Stream<Iterable<S>> mapper(T value), {int? maxConcurrent}) Stream<S>
Converts each item into a Stream. The Stream must return an Iterable. Then, each item from the Iterable will be emitted one by one.