Remove nip46 broker getter, since websocket connections were getting closed and interrupting login flows

This commit is contained in:
Jon Staab
2025-05-07 11:27:25 -07:00
parent 5aec922dee
commit bfa2ac4f53
4 changed files with 82 additions and 74 deletions
+15
View File
@@ -35,6 +35,14 @@ export class LRUCache<T, U> {
this.map.delete(this.keys.shift() as T)
}
}
pop(k: T) {
const v = this.get(k)
this.map.delete(k)
return v
}
}
/**
@@ -64,9 +72,16 @@ export function cached<T, V, Args extends any[]>({
return cache.get(k)!
}
const pop = (...args: Args) => {
const k = getKey(args)
return cache.has(k) ? cache.pop(k)! : getValue(args)
}
get.cache = cache
get.getKey = getKey
get.getValue = getValue
get.pop = pop
return get
}