Skip to content

Commit

Permalink
refactor(makeActionCreation): arrange typing
Browse files Browse the repository at this point in the history
  • Loading branch information
aneurysmjs committed May 18, 2019
1 parent f35fcb9 commit c8f79b0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/app/store/actions/makeActionCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ type ActionType = {
type: string,
};

export default function makeActionCreator<T>(type: string, ...argNames: Array<T>): (Array<T>) => ActionType {
export default function makeActionCreator(type: string, ...argNames: Array<string>): <T>(Array<T>) => ActionType {

return function (...args) {
return function actionCreator(...args) {
let action = { type };
argNames.forEach((arg, index) => {
// $FlowFixMe
action[argNames[index]] = args[index];
});

Expand Down

0 comments on commit c8f79b0

Please sign in to comment.