Skip to content

Commit

Permalink
Pass clearKeptObjects through the weak cache, kriszyp/weak-lru-cache#4
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Jan 27, 2022
1 parent d0f9692 commit 42b0db7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion caching.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WeakLRUCache } from './external.js';
import { WeakLRUCache, clearKeptObjects } from './external.js';
import { FAILED_CONDITION } from './write.js';
let getLastVersion;
const mapGet = Map.prototype.get;
Expand All @@ -25,6 +25,8 @@ export const CachingStore = Store => class extends Store {
});
}
this.db.cachingDb = this;
if (options.cache.clearKeptInterval)
options.cache.clearKeptObjects = clearKeptObjects;
this.cache = new WeakLRUCache(options.cache);
}
get isCaching() {
Expand Down

0 comments on commit 42b0db7

Please sign in to comment.