delete method

  1. @override
Future<void> delete(
  1. String key, {
  2. bool staleOnly = false,
})
override

Removes the given key from store. staleOnly flag will remove it only if the key is expired (from maxStale).

Implementation

@override
Future<void> delete(String key, {bool staleOnly = false}) {
  final resp = _cache.entries[key];
  if (resp == null) return Future.value();

  if (staleOnly && !resp.value.isStaled()) {
    return Future.value();
  }

  _cache.remove(key);

  return Future.value();
}