Skip to content
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

Conversation

RevCBH
Copy link

@RevCBH RevCBH commented Aug 27, 2020

No description provided.

@RevCBH RevCBH requested a review from turbomaze August 27, 2020 02:58
*/

clearCache(cacheName, cacheKey) {
var cache;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit no var


clearCache(cacheName, cacheKey) {
var cache;
switch(cacheName) {

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

throw new Error(`invalid cache name: ${cacheName}`)
}

if (!cacheKey) {

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

Copy link
Author

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.

@RevCBH RevCBH force-pushed the bennetthoffman/ch2890/enable-cache-clearing-in-hsd branch from 138c0b7 to 874f06f Compare August 27, 2020 03:12
@turbomaze turbomaze merged commit 71b0f09 into production-namebase Aug 27, 2020
@turbomaze turbomaze deleted the bennetthoffman/ch2890/enable-cache-clearing-in-hsd branch August 27, 2020 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants