list<T, F extends Fw<T>> static method
CachedFu<T, int, List<T>, F>
list<
T, F extends Fw<T>>({ - required Fu<List<T>> fv,
- required F wrap(
- Fw<T> item
),
- T? defaultValue,
- DspReg? disposers,
})
Implementation
static CachedFu<T, int, List<T>, F> list<T, F extends Fw<T>>({
required Fu<List<T>> fv,
required F Function(Fw<T> item) wrap,
T? defaultValue,
DspReg? disposers,
}) {
final cache = Cache<int, F>((index) {
final item = fv.itemFwHot(
index,
defaultValue: defaultValue,
disposers: disposers,
);
return wrap(item);
});
return CachedFu(
fv: fv,
item: cache.get,
get: (collection, key) =>
key < collection.length ? collection[key] : null,
keys: (collecion) => collecion.mapIndexed((index, element) => index),
sortedKeys: (collecion) =>
collecion.mapIndexed((index, element) => index),
disposers: disposers,
);
}