Hello, The rule `maxAge` being checked only on `get` calls is a bit restrictive to me. In my use case. I use `peek` to select some elements and then I really use only some of them and call `get`. In this way, I keep the last used date accurate to evict the oldest when `max` is reached. Now most of my elements are never accessed using `get` and `maxAge` is not triggered. What do you think about adding a method to check availability or adding a parameter to `get` or `peek` to control `maxAge` eviction? It would prevent me for doing this: ``` javascript // Check manually if the peer is active if (peers.maxAge && (Date.now() - peers.cache[peerId].modified) > peers.maxAge) { peers.remove(peerId) continue } // Don't mark the peer as most recently used on announce var peer = this.peers.peek(peerId) ``` I can propose a PR in this way if you want to.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by yciabaud and has received 12 comments.