Skip to content

Commit

Permalink
style: use function expression in top level
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad Hasani authored and the-dr-lazy committed Jun 15, 2019
1 parent 1e3afca commit 39509ea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/create-handler-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type CreateHandlerMap<TPrevState> = <
* @example
* createHandlerMap([increment, increase], (state: number) => state + 1)
*/
export const createHandlerMap = <
export function createHandlerMap<
TActionCreator extends ActionCreator<string>,
TPrevState,
TNextState extends TPrevState,
Expand All @@ -46,8 +46,8 @@ export const createHandlerMap = <
>(
actionCreators: TActionCreator | TActionCreator[],
handler: Handler<TPrevState, TAction, TNextState>
) =>
(Array.isArray(actionCreators) ? actionCreators : [actionCreators])
) {
return (Array.isArray(actionCreators) ? actionCreators : [actionCreators])
.map(getType)
.reduce<HandlerMap<TPrevState, TAction, TNextState>>(
(acc, type) => {
Expand All @@ -56,3 +56,4 @@ export const createHandlerMap = <
},
{} as any
)
}

0 comments on commit 39509ea

Please sign in to comment.