From 4506a612b650c085562107c06439374b5c7faf81 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Fri, 8 Sep 2023 13:21:57 +0200 Subject: [PATCH 1/2] [TS migration] Migrate 'ActiveClients.js' lib to TypeScript --- src/libs/actions/{ActiveClients.js => ActiveClients.ts} | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) rename src/libs/actions/{ActiveClients.js => ActiveClients.ts} (69%) diff --git a/src/libs/actions/ActiveClients.js b/src/libs/actions/ActiveClients.ts similarity index 69% rename from src/libs/actions/ActiveClients.js rename to src/libs/actions/ActiveClients.ts index 744944cfef1c..9268ef7a9881 100644 --- a/src/libs/actions/ActiveClients.js +++ b/src/libs/actions/ActiveClients.ts @@ -1,11 +1,7 @@ import Onyx from 'react-native-onyx'; import ONYXKEYS from '../../ONYXKEYS'; -/** - * @param {Array} activeClients - * @return {Promise} - */ -function setActiveClients(activeClients) { +function setActiveClients(activeClients: string[]) { return Onyx.set(ONYXKEYS.ACTIVE_CLIENTS, activeClients); } From acb47d15a00cb52f7447dc980afd62d65b37779e Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 11 Sep 2023 17:39:50 +0200 Subject: [PATCH 2/2] Add return type --- src/libs/actions/ActiveClients.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/ActiveClients.ts b/src/libs/actions/ActiveClients.ts index 9268ef7a9881..45fcff402f49 100644 --- a/src/libs/actions/ActiveClients.ts +++ b/src/libs/actions/ActiveClients.ts @@ -1,7 +1,7 @@ import Onyx from 'react-native-onyx'; import ONYXKEYS from '../../ONYXKEYS'; -function setActiveClients(activeClients: string[]) { +function setActiveClients(activeClients: string[]): Promise { return Onyx.set(ONYXKEYS.ACTIVE_CLIENTS, activeClients); }