Closed jimmy-guzman closed 1 year ago
4.3.0
6.0.0
16.14.0
macOS
12.5
Let's say we're using an existing Redis.Cluster client we get the following TypeScript error
Redis.Cluster
Type 'Redis | Cluster' is not assignable to type 'Redis'. Type 'Cluster' is not assignable to type 'Redis'.
import fastifyRedis from "@fastify/redis"; import fastify from "fastify"; import Redis from "ioredis"; const instance = fastify(); const client = new Redis.Cluster([{ host: REDIS_HOST, port: REDIS_PORT }], { redisOptions: { password: REDIS_PASSWORD }, }); instance.register(fastifyRedis, { client, closeClient: true, });
I believe changing this signature to client: Redis | Cluster would fix this issue.
client: Redis | Cluster
PR is welcome. Dont forget to add a typings test.
Prerequisites
Fastify version
4.3.0
Plugin version
6.0.0
Node.js version
16.14.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
12.5
Description
Let's say we're using an existing
Redis.Cluster
client we get the following TypeScript errorSteps to Reproduce
Expected Behavior
I believe changing this signature to
client: Redis | Cluster
would fix this issue.