inFlightRequest<T extends Object> method

Future<T?> inFlightRequest<T extends Object>(
  1. String key
)
inherited

Gets the result of an in-flight request

key - The key of the request Returns a future that completes with the request result

Implementation

Future<T?> inFlightRequest<T extends Object>(String key) async {
  final future = _inFlightSets[T]?[key]?.completer.future;

  if (future == null) {
    return null;
  }

  return (future as Future<T?>).then((value) {
    _inFlightSets[T]?.remove(key);
    return value;
  });
}