-
-
Save digitalconceptvisuals/6a95e30af3119b6e710f63c821f9a2df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set(key, value) { | |
let result = super.set(key, value); | |
// Update the frequency of the key | |
this.#updateFrequency(key); | |
return result; | |
} | |
get(key) { | |
let exists = super.get(key); | |
// Don't update non existing gets | |
if (exists) | |
this.#updateFrequency(key); | |
return exists; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment