Comparing version 0.6.7 to 0.6.8
@@ -75,2 +75,6 @@ "use strict"; | ||
return entry.value; | ||
}; | ||
Cp.clean = function () { | ||
if (typeof this.max === "number") { | ||
@@ -82,4 +86,2 @@ while (this.oldest && | ||
} | ||
return entry.value; | ||
}; | ||
@@ -86,0 +88,0 @@ |
@@ -80,2 +80,13 @@ "use strict"; | ||
// Move this entry to the front of the least-recently used queue, | ||
// since we just finished computing its value. | ||
cache.set(key, entry); | ||
// Clean up any excess entries in the cache, but only if this entry | ||
// has no parents, which means we're not in the middle of a larger | ||
// computation that might be flummoxed by the cleaning. | ||
if (entry.parents.size === 0) { | ||
cache.clean(); | ||
} | ||
// If options.disposable is truthy, the caller of wrap is telling us | ||
@@ -82,0 +93,0 @@ // they don't care about the result of entry.recompute(), so we should |
{ | ||
"name": "optimism", | ||
"version": "0.6.7", | ||
"version": "0.6.8", | ||
"author": "Ben Newman <ben@benjamn.com>", | ||
@@ -5,0 +5,0 @@ "description": "Composable reactive caching with efficient invalidation.", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19547
523