consec3<A, B, C, R> function

FutureOr<R> consec3<A, B, C, R>(
  1. FutureOr<A> a,
  2. FutureOr<B> b,
  3. FutureOr<C> c,
  4. FutureOr<R> callback(
    1. A a,
    2. B b,
    3. C c
    ), {
  5. _TOnErrorCallback? onError,
  6. bool eagerError = true,
  7. _TOnCompleteCallback? onComplete,
})

Maps three synchronous or asynchronous values to a single value.

Implementation

@pragma('vm:prefer-inline')
FutureOr<R> consec3<A, B, C, R>(
  FutureOr<A> a,
  FutureOr<B> b,
  FutureOr<C> c,
  FutureOr<R> Function(A a, B b, C c) callback, {
  _TOnErrorCallback? onError,
  bool eagerError = true,
  _TOnCompleteCallback? onComplete,
}) {
  return wait<R>(
    [a, b, c],
    (items) => callback(
      items.elementAt(0) as A,
      items.elementAt(1) as B,
      items.elementAt(2) as C,
    ),
    onError: onError,
    eagerError: eagerError,
    onComplete: onComplete,
  );
}