From 3fd4100e8975e15857358227782ee6a24974ded9 Mon Sep 17 00:00:00 2001 From: Manzoor Wani Date: Thu, 19 Dec 2024 11:56:26 +0530 Subject: [PATCH] Fix type --- .../src/social-store/selectors/connection-data.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/js-packages/publicize-components/src/social-store/selectors/connection-data.ts b/projects/js-packages/publicize-components/src/social-store/selectors/connection-data.ts index 4c983f7dd8088..2eeeb115ed404 100644 --- a/projects/js-packages/publicize-components/src/social-store/selectors/connection-data.ts +++ b/projects/js-packages/publicize-components/src/social-store/selectors/connection-data.ts @@ -1,4 +1,5 @@ import { REQUEST_TYPE_DEFAULT } from '../actions/constants'; +import { SocialStoreState } from '../types'; /** * Returns the connections list from the store. @@ -7,7 +8,7 @@ import { REQUEST_TYPE_DEFAULT } from '../actions/constants'; * * @return {Array} The connections list */ -export function getConnections( state ) { +export function getConnections( state: SocialStoreState ) { return state.connectionData?.connections ?? []; } @@ -41,7 +42,7 @@ export function getBrokenConnections( state ) { * @param {import("../types").SocialStoreState} state - State object. * @param {string} serviceName - The service name. * - * @return {Array} The connections. + * @return {Array} The connections. */ export function getConnectionsByService( state, serviceName ) { return getConnections( state ).filter( ( { service_name } ) => service_name === serviceName );