You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var fromCache = cache[key];
if (fromCache) {
return fromCache;
}
I think this will not work good if service(colback) that uses it return empty array. It will trigger that service again. The fact that there is nothing in cache[key] does not mean that this was never called before.
My be I am wrong.
The text was updated successfully, but these errors were encountered:
@Serhioromano oops! That was careless on my part. Empty arrays evaluate as truthy, but you are correct that I failed to handle cases where the function returns falsy values, like '' or null, etc. I have pushed the correction.
if (cache.hasOwnProperty(key)) {
return cache[key];
}
You have code like this.
I think this will not work good if service(colback) that uses it return empty array. It will trigger that service again. The fact that there is nothing in cache[key] does not mean that this was never called before.
My be I am wrong.
The text was updated successfully, but these errors were encountered: