combine3<T, A, B, C> static method

FlowState<T> combine3<T, A, B, C>(
  1. FlowState<A> one,
  2. FlowState<B> two,
  3. FlowState<C> three, [
  4. T combiner(
    1. A a,
    2. B b,
    3. C c
    )?,
])

Implementation

static FlowState<T> combine3<T, A, B, C>(
  FlowState<A> one,
  FlowState<B> two,
  FlowState<C> three, [
  T Function(A a, B b, C c)? combiner,
]) {
  combiner ??= (a, b, c) => [a, b, c] as T;
  final combinedStream = Rx.combineLatest3<A, B, C, T>(
    one.stream,
    two.stream,
    three.stream,
    combiner,
  );
  final initialCombinedValue = combiner(one.current, two.current, three.current);
  return FlowState<T>(initialCombinedValue).._subject.addStream(combinedStream);
}