We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ef6156 commit ce32d2fCopy full SHA for ce32d2f
libs/hooks/debounce/src/lib/utils/fixed-size-expiring-cache.ts
@@ -68,7 +68,7 @@ export class FixedSizeExpiringCache<T> {
68
*/
69
set(key: string, value: T) {
70
if (key) {
71
- if (this.cacheMap.size >= this.maxItems) {
+ if (!this.cacheMap.has(key) && this.cacheMap.size >= this.maxItems) {
72
this.evictOldest();
73
}
74
// delete first so that the order is updated when we re-set (Map keeps insertion order)
0 commit comments