const createAction = (type, ...args) => {
let action = { type };
action = Object.assign({}, action, ...args);
return action;
};
export default createAction;
Uso
dispatch(createAction('actionName', { data1, data1 }));
Para valores simples
dispatch(createAction('actionName', { text:'Hello' }));
dispatch(createAction('actionName', { value:false }));