@apollo/client 3.10.0 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -171,6 +171,9 @@ function getFragmentFromSelection(selection, fragmentMap) {
171
171
 
172
172
  var scheduledCleanup = new WeakSet();
173
173
  function schedule(cache) {
174
+ if (cache.size <= (cache.max || -1)) {
175
+ return;
176
+ }
174
177
  if (!scheduledCleanup.has(cache)) {
175
178
  scheduledCleanup.add(cache);
176
179
  setTimeout(function () {
@@ -182,16 +185,18 @@ function schedule(cache) {
182
185
  var AutoCleanedWeakCache = function (max, dispose) {
183
186
  var cache = new caches.WeakCache(max, dispose);
184
187
  cache.set = function (key, value) {
188
+ var ret = caches.WeakCache.prototype.set.call(this, key, value);
185
189
  schedule(this);
186
- return caches.WeakCache.prototype.set.call(this, key, value);
190
+ return ret;
187
191
  };
188
192
  return cache;
189
193
  };
190
194
  var AutoCleanedStrongCache = function (max, dispose) {
191
195
  var cache = new caches.StrongCache(max, dispose);
192
196
  cache.set = function (key, value) {
197
+ var ret = caches.StrongCache.prototype.set.call(this, key, value);
193
198
  schedule(this);
194
- return caches.StrongCache.prototype.set.call(this, key, value);
199
+ return ret;
195
200
  };
196
201
  return cache;
197
202
  };
package/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export var version = "3.10.0";
1
+ export var version = "3.10.1";
2
2
  //# sourceMappingURL=version.js.map