withLatestFrom<S, R> method
Creates a Stream 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.
Example
Stream.fromIterable([1, 2]).withLatestFrom(
Stream.fromIterable([2, 3]), (a, b) => a + b)
.listen(print); // prints 4 (due to the async nature of streams)
Implementation
Stream<R> withLatestFrom<S, R>(
Stream<S> latestFromStream, R Function(T t, S s) fn) =>
WithLatestFromStreamTransformer.with1<T, S, R>(latestFromStream, fn)
.bind(this);