map<T, K, F extends Fr<T>> static method

CachedFr<T, K, Map<K, T>, F> map<T, K, F extends Fr<T>>({
  1. required Fr<Map<K, T>> fv,
  2. required F wrap(
    1. Fr<T> item
    ),
  3. T? defaultValue,
  4. DspReg? disposers,
})

Implementation

static CachedFr<T, K, Map<K, T>, F> map<T, K, F extends Fr<T>>({
  required Fr<Map<K, T>> fv,
  required F Function(Fr<T> item) wrap,
  T? defaultValue,
  DspReg? disposers,
}) {
  final cache = Cache<K, F>((index) {
    final item = fv.itemFrHot(
      index,
      defaultValue: defaultValue,
      disposers: disposers,
    );
    return wrap(item);
  });
  return CachedFr(fv, cache.get);
}