quotaFor method

Future<QuotaFetchResult> quotaFor(
  1. String providerId, {
  2. bool forceRefresh = false,
})

Awaiting read: returns cached when fresh, else fetches (coalesced).

Implementation

Future<QuotaFetchResult> quotaFor(
  String providerId, {
  bool forceRefresh = false,
}) async {
  if (!forceRefresh) {
    final fresh = peek(providerId);
    if (fresh != null) return fresh;
    final inFlight = _inFlight[providerId];
    if (inFlight != null) return inFlight;
  }
  return refresh(providerId);
}