evict method

bool evict(
  1. String entityKey
)

Drops one entity record. False when the store does not hold it. Refused for an owned entity.

Implementation

bool evict(String entityKey) {
  _ready();

  if (_cache.ownsKey(entityKey)) _refuse('evict', entityKey);
  if (!_cache.hasEntity(entityKey)) return false;

  _record(ActionKind.evict, entityKey);

  final dropped = _cache.evictEntity(entityKey);

  _cache.notifyChanged();

  return dropped;
}