skunight / nestjs-redis

nestjs redis module
MIT License
318 stars 173 forks source link

fix(interface): Change onClientReady return type #64

Closed notiv-nt closed 3 years ago

notiv-nt commented 3 years ago

This code gives me an error

RedisModule.register({
  url: '...',
  onClientReady(client) {}
}),
Type '(client: Redis) => void' is not assignable to type '(client: Redis) => Promise<void>'.
  Type 'void' is not assignable to type 'Promise<void>'

https://github.com/skunight/nestjs-redis/blob/fb30456e178dd377e65c733993ae2b744d09ecea/lib/redis-client.provider.ts#L15-L22

onClientReady is not awaited, so Promise<> is useless