with3<T, A, B, C, R> static method

WithLatestFromStreamTransformer<T, dynamic, R> with3<T, A, B, C, R>(
  1. Stream<A> latestFromStream1,
  2. Stream<B> latestFromStream2,
  3. Stream<C> latestFromStream3,
  4. R fn(
    1. T t,
    2. A a,
    3. B b,
    4. C c,
    ),
)

Constructs a StreamTransformer that emits when the source Stream emits, combining the latest values from all latestFromStreams using the provided function fn.

Implementation

static WithLatestFromStreamTransformer<T, dynamic, R> with3<T, A, B, C, R>(
  Stream<A> latestFromStream1,
  Stream<B> latestFromStream2,
  Stream<C> latestFromStream3,
  R Function(T t, A a, B b, C c) fn,
) =>
    WithLatestFromStreamTransformer<T, dynamic, R>(
      [
        latestFromStream1,
        latestFromStream2,
        latestFromStream3,
      ],
      (s, values) {
        return fn(
          s,
          values[0] as A,
          values[1] as B,
          values[2] as C,
        );
      },
    );