Skip to content

Instantly share code, notes, and snippets.

@Joe1220
Created August 11, 2018 13:46
Show Gist options
  • Select an option

  • Save Joe1220/f85a0d8da70636879ce81fc171a2bb46 to your computer and use it in GitHub Desktop.

Select an option

Save Joe1220/f85a0d8da70636879ce81fc171a2bb46 to your computer and use it in GitHub Desktop.
import { connect } from "react-redux";
import { actionCreators as procutsActions } from "redux/modules/products";
import Container from "./container";
const mapStateToProps = (state, ownProps) => {
const { products: { items } } = state;
return {
items
};
};
const mapDispatchToProps = (dispatch, ownProps) => {
return {
getProducts: () => {
dispatch(procutsActions.getProducts());
}
};
};
export default connect(mapStateToProps, mapDispatchToProps)(Container);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment