Preview: index.ts
Size: 248 B
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/@emotion/memoize/src/index.ts
export default function memoize<V>(fn: (arg: string) => V): (arg: string) => V {
const cache: Record<string, V> = Object.create(null)
return (arg: string) => {
if (cache[arg] === undefined) cache[arg] = fn(arg)
return cache[arg]
}
}
Directory Contents
Dirs: 0 × Files: 1