WithLatestFromExtensions<T> extension

Extends the Stream class with the ability to merge the source Stream with the last emitted item from another Stream.

on

Methods

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

Available on Stream<T>, provided by the WithLatestFromExtensions extension

Creates a Stream that emits when the source stream emits, combining the latest values from the two streams using the provided function.
withLatestFrom2<A, B, R>(Stream<A> latestFromStream1, Stream<B> latestFromStream2, R fn(T t, A a, B b)) Stream<R>

Available on Stream<T>, provided by the WithLatestFromExtensions extension

Creates a Stream that emits when the source stream emits, combining the latest values from the three streams using the provided function.
withLatestFrom3<A, B, C, R>(Stream<A> latestFromStream1, Stream<B> latestFromStream2, Stream<C> latestFromStream3, R fn(T t, A a, B b, C c)) Stream<R>

Available on Stream<T>, provided by the WithLatestFromExtensions extension

Creates a Stream that emits when the source stream emits, combining the latest values from the four streams using the provided function.
withLatestFrom4<A, B, C, D, R>(Stream<A> latestFromStream1, Stream<B> latestFromStream2, Stream<C> latestFromStream3, Stream<D> latestFromStream4, R fn(T t, A a, B b, C c, D d)) Stream<R>

Available on Stream<T>, provided by the WithLatestFromExtensions extension

Creates a Stream that emits when the source stream emits, combining the latest values from the five streams using the provided function.
withLatestFrom5<A, B, C, D, E, R>(Stream<A> latestFromStream1, Stream<B> latestFromStream2, Stream<C> latestFromStream3, Stream<D> latestFromStream4, Stream<E> latestFromStream5, R fn(T t, A a, B b, C c, D d, E e)) Stream<R>

Available on Stream<T>, provided by the WithLatestFromExtensions extension

Creates a Stream that emits when the source stream emits, combining the latest values from the six streams using the provided function.
withLatestFrom6<A, B, C, D, E, F, R>(Stream<A> latestFromStream1, Stream<B> latestFromStream2, Stream<C> latestFromStream3, Stream<D> latestFromStream4, Stream<E> latestFromStream5, Stream<F> latestFromStream6, R fn(T t, A a, B b, C c, D d, E e, F f)) Stream<R>

Available on Stream<T>, provided by the WithLatestFromExtensions extension

Creates a Stream that emits when the source stream emits, combining the latest values from the seven streams using the provided function.
withLatestFrom7<A, B, C, D, E, F, G, R>(Stream<A> latestFromStream1, Stream<B> latestFromStream2, Stream<C> latestFromStream3, Stream<D> latestFromStream4, Stream<E> latestFromStream5, Stream<F> latestFromStream6, Stream<G> latestFromStream7, R fn(T t, A a, B b, C c, D d, E e, F f, G g)) Stream<R>

Available on Stream<T>, provided by the WithLatestFromExtensions extension

Creates a Stream that emits when the source stream emits, combining the latest values from the eight streams using the provided function.
withLatestFrom8<A, B, C, D, E, F, G, H, R>(Stream<A> latestFromStream1, Stream<B> latestFromStream2, Stream<C> latestFromStream3, Stream<D> latestFromStream4, Stream<E> latestFromStream5, Stream<F> latestFromStream6, Stream<G> latestFromStream7, Stream<H> latestFromStream8, R fn(T t, A a, B b, C c, D d, E e, F f, G g, H h)) Stream<R>

Available on Stream<T>, provided by the WithLatestFromExtensions extension

Creates a Stream that emits when the source stream emits, combining the latest values from the nine streams using the provided function.
withLatestFrom9<A, B, C, D, E, F, G, H, I, R>(Stream<A> latestFromStream1, Stream<B> latestFromStream2, Stream<C> latestFromStream3, Stream<D> latestFromStream4, Stream<E> latestFromStream5, Stream<F> latestFromStream6, Stream<G> latestFromStream7, Stream<H> latestFromStream8, Stream<I> latestFromStream9, R fn(T t, A a, B b, C c, D d, E e, F f, G g, H h, I i)) Stream<R>

Available on Stream<T>, provided by the WithLatestFromExtensions extension

Creates a Stream that emits when the source stream emits, combining the latest values from the ten streams using the provided function.
withLatestFromList(Iterable<Stream<T>> latestFromStreams) Stream<List<T>>

Available on Stream<T>, provided by the WithLatestFromExtensions extension

Creates a Stream that emits when the source stream emits, combining the latest values from the streams into a list. This is helpful when you need to combine a dynamic number of Streams.