upsert method

void upsert (String key, T value, [ Duration expires ])
override

Set the given key/value in the cache, overwriting any existing value associated with that key

Implementation

void upsert(String key, T value, [Duration expires]) {
  expires ??= defaultExpiry;
  if (expires != null && expires.isNegative) expires = null;
  _store[key] = new CacheItem.duration(value, expires);
}