mergeAsyncValues3<R, A, B, C> function
- AsyncValue<
A> a, - AsyncValue<
B> b, - AsyncValue<
C> c, - R callback(
- A,
- B,
- C
Merges three async values into one async value using the provided
callback function.
Implementation
AsyncValue<R> mergeAsyncValues3<R, A, B, C>(
AsyncValue<A> a,
AsyncValue<B> b,
AsyncValue<C> c,
R Function(A, B, C) callback,
) {
final merged = a.mergeWith<B, List>(b, (a, b) => [a, b]);
return merged.mergeWith<C, R>(
c,
(list, c) => callback(list[0], list[1], c),
);
}