File tree Expand file tree Collapse file tree 1 file changed +3
-21
lines changed Expand file tree Collapse file tree 1 file changed +3
-21
lines changed Original file line number Diff line number Diff line change 1
- import {
2
- ActionCreator ,
3
- ActionCreatorsMapObject ,
4
- AnyAction ,
5
- Dispatch ,
6
- } from 'redux'
7
-
8
- function bindActionCreator < A extends AnyAction = AnyAction > (
9
- actionCreator : ActionCreator < A > ,
10
- dispatch : Dispatch
11
- ) {
12
- return function ( this : any , ...args : any [ ] ) {
13
- return dispatch ( actionCreator . apply ( this , args ) )
14
- }
15
- }
1
+ import { ActionCreatorsMapObject , Dispatch } from 'redux'
16
2
17
3
export default function bindActionCreators (
18
- actionCreators : ActionCreator < any > | ActionCreatorsMapObject ,
4
+ actionCreators : ActionCreatorsMapObject ,
19
5
dispatch : Dispatch
20
6
) {
21
- if ( typeof actionCreators === 'function' ) {
22
- return bindActionCreator ( actionCreators , dispatch )
23
- }
24
-
25
- const boundActionCreators : ActionCreatorsMapObject = { }
7
+ const boundActionCreators : ActionCreatorsMapObject < any > = { }
26
8
for ( const key in actionCreators ) {
27
9
const actionCreator = actionCreators [ key ]
28
10
if ( typeof actionCreator === 'function' ) {
You can’t perform that action at this time.
0 commit comments