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. void onError(
    1. Object e
    )?,
})

Maps two synchronous or asynchronous values to a single value.

Implementation

FutureOr<R> consec2<A, B, R>(
  FutureOr<A> a,
  FutureOr<B> b,
  FutureOr<R> Function(A a, B b) callback, {
  void Function(Object e)? onError,
}) {
  return consecList<R>(
    [a, b],
    (items) => callback(
      items[0] as A,
      items[1] as B,
    ),
  );
}