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