consec2<A, B, R> function

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

Maps two synchronous or asynchronous values to a single value.

Implementation

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