Comparing version
@@ -460,2 +460,3 @@ 'use strict'; | ||
} | ||
var caches = new Set(); | ||
function wrap(originalFunction, options) { | ||
@@ -496,2 +497,3 @@ if (options === void 0) { options = Object.create(null); } | ||
cache.set(key, entry); | ||
caches.add(cache); | ||
// Clean up any excess entries in the cache, but only if there is no | ||
@@ -501,3 +503,4 @@ // active parent entry, meaning we're not in the middle of a larger | ||
if (!parentEntrySlot.hasValue()) { | ||
cache.clean(); | ||
caches.forEach(function (cache) { return cache.clean(); }); | ||
caches.clear(); | ||
} | ||
@@ -504,0 +507,0 @@ // If options.disposable is truthy, the caller of wrap is telling us |
@@ -457,2 +457,3 @@ import { Slot } from '@wry/context'; | ||
} | ||
var caches = new Set(); | ||
function wrap(originalFunction, options) { | ||
@@ -493,2 +494,3 @@ if (options === void 0) { options = Object.create(null); } | ||
cache.set(key, entry); | ||
caches.add(cache); | ||
// Clean up any excess entries in the cache, but only if there is no | ||
@@ -498,3 +500,4 @@ // active parent entry, meaning we're not in the middle of a larger | ||
if (!parentEntrySlot.hasValue()) { | ||
cache.clean(); | ||
caches.forEach(function (cache) { return cache.clean(); }); | ||
caches.clear(); | ||
} | ||
@@ -501,0 +504,0 @@ // If options.disposable is truthy, the caller of wrap is telling us |
{ | ||
"name": "optimism", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"author": "Ben Newman <ben@benjamn.com>", | ||
@@ -5,0 +5,0 @@ "description": "Composable reactive caching with efficient invalidation.", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
113628
0.78%1124
0.54%