ioredis
ioredis copied to clipboard
How to use psubscribe with ioredis 5 from typescript
Just did a short check whether it is possible to migrate to ioredis 5 and i completely fail in using psubscribe from typescript.
I have no clue what ioredis expects here:
psubscribe(...args: [...patterns: string[]]): Result<unknown, Context>;
The @types implementation of ioredis states:
psubscribe(...patterns: string[]): Pipeline;
Which was fullfilled by simply calling the function with a "string"
obj.psubscribe("mypattern");
Am i missing something?
Hey @JanFellner 👋
...args: [...patterns: string[]] is actually the same as ...patterns: string[] so you can continue using obj.psubscribe("mypattern").
The typing seems unnecessarily complex though. We should change it to ...patterns: string[].
Hey @luin, thanks for the quick response. Yeah typing here could be simplified (trivial though :))