ExhaustMapStreamTransformer<S, T> class

Converts events from the source stream into a new Stream using a given mapper. It ignores all items from the source stream until the new stream completes.

Useful when you have a noisy source Stream and only want to respond once the previous async operation is finished.

Example

// Emits 0, 1, 2
Stream.periodic(Duration(milliseconds: 200), (i) => i).take(3)
  .transform(ExhaustMapStreamTransformer(
    // Emits the value it's given after 200ms
    (i) => Rx.timer(i, Duration(milliseconds: 200)),
  ))
.listen(print); // prints 0, 2
Inheritance

Constructors

ExhaustMapStreamTransformer(Stream<T> mapper(S value))
Constructs a StreamTransformer which maps each event from the source Stream using mapper.

Properties

hashCode int
The hash code for this object.
no setterinherited
mapper Stream<T> Function(S value)
Method which converts incoming events into a new Stream
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bind(Stream<S> stream) Stream<T>
Transforms the provided stream.
override
cast<RS, RT>() StreamTransformer<RS, RT>
Provides a StreamTransformer<RS, RT> view of this stream transformer.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited