@type-cacheable/lru-cache-adapter
Advanced tools
Comparing version
@@ -13,2 +13,2 @@ import * as LRUCache from 'lru-cache'; | ||
} | ||
export declare const useAdapter: <T>(client: LRUCache<string, T>, asFallback?: boolean | undefined) => void; | ||
export declare const useAdapter: <T>(client: LRUCache<string, T>, asFallback?: boolean | undefined) => LRUCacheAdapter<T>; |
@@ -80,3 +80,3 @@ "use strict"; | ||
exports.LRUCacheAdapter = LRUCacheAdapter; | ||
exports.useAdapter = (client, asFallback) => { | ||
const useAdapter = (client, asFallback) => { | ||
const lruCacheAdapter = new LRUCacheAdapter(client); | ||
@@ -89,3 +89,5 @@ if (asFallback) { | ||
} | ||
return lruCacheAdapter; | ||
}; | ||
exports.useAdapter = useAdapter; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@type-cacheable/lru-cache-adapter", | ||
"version": "9.0.1", | ||
"version": "9.1.0", | ||
"description": "Adapter for using lru-cache with type-cacheable", | ||
@@ -38,3 +38,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@type-cacheable/core": "^9.0.1", | ||
"@type-cacheable/core": "^9.1.0", | ||
"@types/jest": "^26.0.0", | ||
@@ -49,3 +49,3 @@ "@types/lru-cache": "^5.1.0", | ||
}, | ||
"gitHead": "b667a76bdef5ae84d5d4cac1fef6c9721e00c3cb" | ||
"gitHead": "5dd4edfc1d5f9bc0b814c02d889c07537182b42f" | ||
} |
@@ -28,5 +28,5 @@ # @type-cacheable/lru-cache-adapter | ||
const client = new LRUCache(); | ||
useAdapter(client); | ||
const clientAdapter = useAdapter(client); | ||
``` | ||
Then you can rely on the `@Cacheable`, `@CacheUpdate`, and `@CacheClear` decorators from `@type-cacheable/core`. [See core documentation](https://github.com/joshuaslate/type-cacheable/tree/main/packages/core) |
Sorry, the diff of this file is not supported yet
9880
1.44%103
1.98%