await2<A, B> function

Future<Tuple2<A, B>> await2<A, B>(
  1. Future<A> a,
  2. Future<B> b
)

Waits for both futures and returns a future containing a Tuple2 with the results of both futures

Implementation

Future<Tuple2<A, B>> await2<A, B>(Future<A> a, Future<B> b) {
  return Future.wait([a, b]).then((values) => Tuple2.fromList(values));
}