From 15e604f2f37524a9bc39e35a61bc6d26696fd31e Mon Sep 17 00:00:00 2001 From: Frank Tan Date: Sun, 27 Aug 2017 16:11:16 -0400 Subject: [PATCH] [react-redux] Make `connect` input types optional For convenience. --- types/react-redux/index.d.ts | 22 +++++++++++----------- types/react-redux/react-redux-tests.tsx | 10 +++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index b83252a745..44c18a91a5 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -67,66 +67,66 @@ export type InferableComponentEnhancer = */ export declare function connect(): InferableComponentEnhancer>; -export declare function connect( +export declare function connect( mapStateToProps: MapStateToPropsParam ): InferableComponentEnhancerWithProps, TOwnProps>; -export declare function connect( +export declare function connect( mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam ): InferableComponentEnhancerWithProps; -export declare function connect( +export declare function connect( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam ): InferableComponentEnhancerWithProps; -export declare function connect( +export declare function connect( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: null | undefined, mergeProps: MergeProps, ): InferableComponentEnhancerWithProps; -export declare function connect( +export declare function connect( mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: MergeProps, ): InferableComponentEnhancerWithProps; -export declare function connect( +export declare function connect( mapStateToProps: null | undefined, mapDispatchToProps: null | undefined, mergeProps: MergeProps, ): InferableComponentEnhancerWithProps; -export declare function connect( +export declare function connect( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: MergeProps, ): InferableComponentEnhancerWithProps; -export declare function connect( +export declare function connect( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: null | undefined, mergeProps: null | undefined, options: Options ): InferableComponentEnhancerWithProps & TStateProps, TOwnProps>; -export declare function connect( +export declare function connect( mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: null | undefined, options: Options ): InferableComponentEnhancerWithProps; -export declare function connect( +export declare function connect( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: null | undefined, options: Options ): InferableComponentEnhancerWithProps; -export declare function connect( +export declare function connect( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: MergeProps, diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 5a9b038dc5..619a25a7df 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -57,26 +57,26 @@ interface ICounterDispatchProps { onIncrement: () => void } // with higher order functions -connect( +connect( () => mapStateToProps, () => mapDispatchToProps )(Counter); // with higher order functions using parameters -connect( +connect( (initialState: CounterState, ownProps) => mapStateToProps, (dispatch: Dispatch, ownProps) => mapDispatchToProps )(Counter); // only first argument -connect( +connect( () => mapStateToProps )(Counter); // wrap only one argument -connect( +connect( mapStateToProps, () => mapDispatchToProps )(Counter); // with extra arguments -connect( +connect( () => mapStateToProps, () => mapDispatchToProps, (s: ICounterStateProps, d: ICounterDispatchProps) =>