From a5c4916a058c791aadad0808fb0eab089d86f7f9 Mon Sep 17 00:00:00 2001 From: Fabrizio Vitale Date: Wed, 30 Jun 2021 16:06:34 +0200 Subject: [PATCH] [TS-prototype]: convert verifySubselectors to TS #1737 (#1748) --- ...rifySubselectors.js => verifySubselectors.ts} | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) rename src/connect/{verifySubselectors.js => verifySubselectors.ts} (76%) diff --git a/src/connect/verifySubselectors.js b/src/connect/verifySubselectors.ts similarity index 76% rename from src/connect/verifySubselectors.js rename to src/connect/verifySubselectors.ts index 93c4f7cf4..dd7705a2f 100644 --- a/src/connect/verifySubselectors.js +++ b/src/connect/verifySubselectors.ts @@ -1,6 +1,10 @@ import warning from '../utils/warning' -function verify(selector, methodName, displayName) { +function verify( + selector: unknown, + methodName: string, + displayName: string +): void { if (!selector) { throw new Error(`Unexpected value for ${methodName} in ${displayName}.`) } else if ( @@ -16,11 +20,11 @@ function verify(selector, methodName, displayName) { } export default function verifySubselectors( - mapStateToProps, - mapDispatchToProps, - mergeProps, - displayName -) { + mapStateToProps: unknown, + mapDispatchToProps: unknown, + mergeProps: unknown, + displayName: string +): void { verify(mapStateToProps, 'mapStateToProps', displayName) verify(mapDispatchToProps, 'mapDispatchToProps', displayName) verify(mergeProps, 'mergeProps', displayName)