getWhere method

List<T> getWhere(
  1. bool function(
    1. CacheItem<T>
    )
)

Implementation

List<T> getWhere(bool Function(CacheItem<T>) function) {
  final items = _cache.where(function);

  final List<T> list = [];

  for (final item in items) {
    if (_isItemOutdated(item)) {
      removeItem(item);
    } else {
      list.add(item.item);
    }
  }

  return list;
}