Skip to content

Commit dbc95c8

Browse files
cellogtimdorr
authored andcommitted
fixes to bindActionCreators overloads (#3552)
1 parent 8112c95 commit dbc95c8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/bindActionCreators.ts

+19
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,25 @@ function bindActionCreator<A extends AnyAction = AnyAction>(
3535
* function as `actionCreators`, the return value will also be a single
3636
* function.
3737
*/
38+
export default function bindActionCreators<A, C extends ActionCreator<A>>(
39+
actionCreator: C,
40+
dispatch: Dispatch
41+
): C
42+
43+
export default function bindActionCreators<
44+
A extends ActionCreator<any>,
45+
B extends ActionCreator<any>
46+
>(actionCreator: A, dispatch: Dispatch): B
47+
48+
export default function bindActionCreators<
49+
A,
50+
M extends ActionCreatorsMapObject<A>
51+
>(actionCreators: M, dispatch: Dispatch): M
52+
export default function bindActionCreators<
53+
M extends ActionCreatorsMapObject<any>,
54+
N extends ActionCreatorsMapObject<any>
55+
>(actionCreators: M, dispatch: Dispatch): N
56+
3857
export default function bindActionCreators(
3958
actionCreators: ActionCreator<any> | ActionCreatorsMapObject,
4059
dispatch: Dispatch

0 commit comments

Comments
 (0)