Created
August 11, 2018 13:46
-
-
Save Joe1220/f85a0d8da70636879ce81fc171a2bb46 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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