File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,21 @@ export function createActionHelper(dispatch: Dispatch, actionCreator: Function):
10
10
return ( ...args ) => dispatch ( actionCreator ( ...args ) ) ;
11
11
}
12
12
13
+ /*
14
+ * returns an array of simple (synchronous) action helpers when passed the
15
+ * dispatch function and an array of synchronous action creators
16
+ */
13
17
export type ActionHelpers = Array < { [ k : string ] : ( ...args : any ) => void } > ;
14
18
export function createSimpleActionHelpers ( dispatch : Dispatch , actionList : ActionCreator [ ] ) : ActionHelpers {
15
19
return actionList . map ( actionCreator => (
16
20
{ [ actionCreator . name ] : createActionHelper ( dispatch , actionCreator ) }
17
21
) ) ;
18
22
}
19
23
24
+ /*
25
+ * returns an array of async action helpers from async action creators (those
26
+ * that return a function taking dispatch as an argument)
27
+ */
20
28
export type AsyncActionHelpers = Array < { [ k : string ] : AsyncActionHelper } > ;
21
29
export function createAsyncActionHelpers ( dispatch : Dispatch , actionList : AsyncActionCreator [ ] ) : AsyncActionHelpers {
22
30
return actionList . map ( actionCreator => (
You can’t perform that action at this time.
0 commit comments