combine5<T, A, B, C, D, E> static method

FlowState<T> combine5<T, A, B, C, D, E>(
  1. FlowState<A> one,
  2. FlowState<B> two,
  3. FlowState<C> three,
  4. FlowState<D> four,
  5. FlowState<E> five, [
  6. T combiner(
    1. A a,
    2. B b,
    3. C c,
    4. D d,
    5. E e,
    )?,
])

Implementation

static FlowState<T> combine5<T, A, B, C, D, E>(
  FlowState<A> one,
  FlowState<B> two,
  FlowState<C> three,
  FlowState<D> four,
  FlowState<E> five, [
  T Function(A a, B b, C c, D d, E e)? combiner,
]) {
  combiner ??= (a, b, c, d, e) => [a, b, c, d, e] as T;
  final combinedStream = Rx.combineLatest5<A, B, C, D, E, T>(
    one.stream,
    two.stream,
    three.stream,
    four.stream,
    five.stream,
    combiner,
  );
  final initialCombinedValue = combiner(
    one.current,
    two.current,
    three.current,
    four.current,
    five.current,
  );
  return FlowState<T>(initialCombinedValue).._subject.addStream(combinedStream);
}