We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a9e3e9 commit ac4797eCopy full SHA for ac4797e
src/onCacheWrite.ts
@@ -10,6 +10,7 @@ export default <T>({ cache }: TriggerFunctionConfig<T>) => (
10
const write = cache.write;
11
const evict = cache.evict;
12
const modify = cache.modify;
13
+ const gc = cache.gc;
14
15
cache.write = (...args: any[]) => {
16
const result = write.apply(cache, args);
@@ -26,10 +27,17 @@ export default <T>({ cache }: TriggerFunctionConfig<T>) => (
26
27
persist();
28
return result;
29
};
30
+ cache.gc = (...args: any[]) => {
31
+ const result = gc.apply(cache, args);
32
+ persist();
33
+ return result;
34
+ };
35
+
36
37
return () => {
38
cache.write = write;
39
cache.evict = evict;
40
cache.modify = modify;
41
+ cache.gc = gc;
42
43
0 commit comments