waitFuturesAndReturnValue<V> method

FutureOr<V> waitFuturesAndReturnValue<V>(
  1. V value
)

Waits futures and returns value.

Implementation

FutureOr<V> waitFuturesAndReturnValue<V>(V value) {
  var futures = selectFutures();
  if (futures.isEmpty) {
    return value;
  } else {
    return Future.wait(futures).then((_) => value);
  }
}