- cached<T, V, Args extends any[]>(
__namedParameters: {
getKey: (args: Args) => T;
getValue: (args: Args) => V;
maxSize: number;
},
): {
cache: LRUCache<T, V>;
getKey: (args: Args) => T;
getValue: (args: Args) => V;
(...args: Args): NonNullable<V>;
} Parameters
- __namedParameters: { getKey: (args: Args) => T; getValue: (args: Args) => V; maxSize: number }
Returns {
cache: LRUCache<T, V>;
getKey: (args: Args) => T;
getValue: (args: Args) => V;
(...args: Args): NonNullable<V>;
}
Creates a memoized function with LRU caching