-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for clearing HSD caches #28
Support for clearing HSD caches #28
Conversation
lib/wallet/wallet.js
Outdated
*/ | ||
|
||
clearCache(cacheName, cacheKey) { | ||
var cache; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit no var
lib/wallet/wallet.js
Outdated
|
||
clearCache(cacheName, cacheKey) { | ||
var cache; | ||
switch(cacheName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style nit: switches in javascript are very error prone, missing some of the protections that languages like go give you, would prefer if/else if/else
lib/wallet/wallet.js
Outdated
throw new Error(`invalid cache name: ${cacheName}`) | ||
} | ||
|
||
if (!cacheKey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't matter at all given our keys, but as a general comment about this type of check since it may apply in other code in the future, would use an explicit undefined or null check here since the empty string is falsey but could be a valid key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was including the empty string in the set of desirably false-y keys, but can check for it explicitly.
138c0b7
to
874f06f
Compare
No description provided.