@type-cacheable/redis-adapter
Advanced tools
Comparing version 9.0.1 to 9.1.0
@@ -36,2 +36,2 @@ import { RedisClient, Callback } from 'redis'; | ||
} | ||
export declare const useAdapter: (client: RedisClient, asFallback?: boolean | undefined) => void; | ||
export declare const useAdapter: (client: RedisClient, asFallback?: boolean | undefined) => RedisAdapter; |
@@ -237,3 +237,3 @@ "use strict"; | ||
}; | ||
exports.useAdapter = (client, asFallback) => { | ||
const useAdapter = (client, asFallback) => { | ||
const redisAdapter = new RedisAdapter(client); | ||
@@ -246,3 +246,5 @@ if (asFallback) { | ||
} | ||
return redisAdapter; | ||
}; | ||
exports.useAdapter = useAdapter; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@type-cacheable/redis-adapter", | ||
"version": "9.0.1", | ||
"version": "9.1.0", | ||
"description": "Adapter for using redis 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", | ||
@@ -54,3 +54,3 @@ "@types/redis": "^2.8.13", | ||
}, | ||
"gitHead": "b667a76bdef5ae84d5d4cac1fef6c9721e00c3cb" | ||
"gitHead": "5dd4edfc1d5f9bc0b814c02d889c07537182b42f" | ||
} |
@@ -28,5 +28,5 @@ # @type-cacheable/redis-adapter | ||
const client = Redis.createClient(); | ||
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
23563
283