find method

  1. @override
Future<JsonApiDocument> find(
  1. String endpoint,
  2. String id, {
  3. bool forceReload = false,
})
override

Implementation

@override
Future<JsonApiDocument> find(String endpoint, String id,
    {bool forceReload = false}) async {
  if (forceReload == true) {
    return fetchAndCache(endpoint, id);
  }
  JsonApiDocument? cached = peek(endpoint, id);
  if (cached != null) {
    return cached;
  } else {
    return fetchAndCache(endpoint, id);
  }
}