Created
October 29, 2018 16:20
-
-
Save Joe1220/76daadc29ca9efa6c6f0e51c8f3670c4 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 AppContainer from "./presenter"; | |
import { actionCreators as photoActions } from "../../redux/modules/photos"; | |
import { actionCreators as userActions } from "../../redux/modules/user"; | |
const mapStateToProps = (state, ownProps) => { | |
const { user } = state; | |
return { | |
isLoggedIn: user.isLoggedIn, | |
profile: user.profile | |
}; | |
}; | |
const mapDispatchToProps = (dispatch, ownProps) => { | |
return { | |
initApp: () => { | |
dispatch(photoActions.getFeed()); | |
dispatch(photoActions.getSearch()); | |
dispatch(userActions.getNotifications()); | |
dispatch(userActions.getOwnProfile()); | |
} | |
}; | |
}; | |
export default connect(mapStateToProps, mapDispatchToProps)(AppContainer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment