score:3

Accepted answer

since these functions just return an object (which is then handled by the consumer hoc) you can use es6 spreading -

export const appmapdispatchtoprops = dispatch => {
    return {
        ...countermapdispatchtoprops(dispatch),
        ...statusmapdispatchtoprops(dispatch),
    }
}

you can add more functions to this, and of course import them from other files.


if you need es5, you can use object.assign to similar effect:

export const appmapdispatchtoprops = function(dispatch) {
    return object.assign(countermapdispatchtoprops(dispatch), statusmapdispatchtoprops(dispatch));
}

Related Query

More Query from same tag