I have redux actions which are small simple function in many files. I then combine them in a single file as below. This file is named moduleActions.js
import * as actions1 from './someActions';
import * as actions2 from './moreActions';
import * as actions3 from './someMoreActions';
const moduleActions = Object.assign({}, actions1, actions2, actions3);
export default moduleActions
How do I export moduleActions without the default? The code above works but my functions coming from actions1, actions2, etc are inside the default object -- see below:
{
default: {
function1(),
function2()
}
}
I don't want the default object in there. My functions should be in the main object:
{
function1(),
function2()
}
I tried exporting moduleActions without the default
but that gives me an error.
UPDATE: Solution seems to be exporting them directly without even trying to combine them. So my moduleActions.js file now looks like this:
export * from './someActions';
export * from './moreActions';
export * from './someMoreActions';