Cache getSigner instead of strictly memoizing

This commit is contained in:
Jon Staab
2024-11-13 13:11:55 -08:00
parent 78bc9df7a6
commit b1f92f05bb
2 changed files with 25 additions and 25 deletions
+3 -7
View File
@@ -46,15 +46,11 @@ export function cached<T, V, Args extends any[]>({
const get = (...args: Args) => {
const k = getKey(args)
let v = cache.get(k)
if (!v) {
v = getValue(args)
cache.set(k, v)
if (!cache.has(k)) {
cache.set(k, getValue(args))
}
return v
return cache.get(k)
}
get.cache = cache