mirror of
https://github.com/apache/superset.git
synced 2026-05-12 11:25:56 +00:00
chore: upgrade eslint, babel, and prettier (#12393)
This commit is contained in:
@@ -21,14 +21,12 @@ export const cacheWrapper = <T extends Array<any>, U>(
|
||||
fn: (...args: T) => U,
|
||||
cache: Map<string, any>,
|
||||
keyFn: (...args: T) => string = (...args: T) => JSON.stringify([...args]),
|
||||
) => {
|
||||
return (...args: T): U => {
|
||||
const key = keyFn(...args);
|
||||
if (cache.has(key)) {
|
||||
return cache.get(key);
|
||||
}
|
||||
const result = fn(...args);
|
||||
cache.set(key, result);
|
||||
return result;
|
||||
};
|
||||
) => (...args: T): U => {
|
||||
const key = keyFn(...args);
|
||||
if (cache.has(key)) {
|
||||
return cache.get(key);
|
||||
}
|
||||
const result = fn(...args);
|
||||
cache.set(key, result);
|
||||
return result;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user