Skip to content

Commit 1398321

Browse files
committed
Factor out assignment in expression
1 parent d1cbd3f commit 1398321

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎src/slack.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ interface SlackInteraction {
3333
let client: WebClient | null = null;
3434

3535
function getClient(): WebClient {
36-
if (client !== null) {
37-
return client;
38-
}
39-
return (client = new WebClient(getConfig("SLACK_TOKEN")));
36+
client ??= new WebClient(getConfig("SLACK_TOKEN"));
37+
return client;
4038
}
4139

4240
export async function updateMessage({ action, messageTs, repo, userId, userName }: MessageRef): Promise<void> {

0 commit comments

Comments
 (0)