WithLatestFromStreamTransformer<T, S, R> class

A StreamTransformer that emits when the source stream emits, combining the latest values from the two streams using the provided function.

If the latestFromStream has not emitted any values, this stream will not emit either.

Interactive marble diagram

Example

new Stream.fromIterable([1, 2]).transform(
  new WithLatestFromStreamTransformer(
    new Stream.fromIterable([2, 3]), (a, b) => a + b)
  .listen(print); // prints 4 (due to the async nature of streams)

Constructors

WithLatestFromStreamTransformer(Stream<S> latestFromStream, R fn(T t, S s))

Properties

transformer → StreamTransformer<T, R>
final
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

bind(Stream<T> stream) → Stream<R>
Transforms the provided stream. [...]
cast<RS, RT>() → StreamTransformer<RS, RT>
Provides a StreamTransformer<RS, RT> view of this stream transformer.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited