10 lines
215 B
JavaScript
10 lines
215 B
JavaScript
export default (type, ...argNames) => {
|
|
return function(...args) {
|
|
let action = { type };
|
|
argNames.forEach((arg, index) => {
|
|
action[argNames[index]] = args[index];
|
|
});
|
|
return action;
|
|
};
|
|
};
|