From 63e124f88d6f9aa90668ce2d4e93949c9cc49921 Mon Sep 17 00:00:00 2001 From: Ponez Date: Sun, 12 Mar 2023 19:20:19 +0330 Subject: [PATCH] Some optimization with new && operator --- lib/redis-client.provider.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/redis-client.provider.ts b/lib/redis-client.provider.ts index eac33a1..15e14ba 100644 --- a/lib/redis-client.provider.ts +++ b/lib/redis-client.provider.ts @@ -15,9 +15,7 @@ export interface RedisClient { async function getClient(options: RedisModuleOptions): Promise { const { onClientReady, url, ...opt } = options; const client = url ? new Redis(url) : new Redis(opt); - if (onClientReady) { - onClientReady(client) - } + onClientReady && onClientReady(client); return client; }