DEV Community

Discussion on: Redux Best Practices

Collapse
 
pak11273 profile image
Isaac Pak

Instead of this:

const mapDispatchToProps = {
decrement: () => ({ type: "DECREMENT" }),
increment: () => ({ type: "INCREMENT" }),
getColors: params => getColors(params), //If passing variables to the action
};

why not just do this:

export default connect(mapStateToProps, { decrement, increment, getColors })(MyComponent);