Skip to content

Instantly share code, notes, and snippets.

@Joe1220
Created October 29, 2018 16:20
Show Gist options
  • Save Joe1220/76daadc29ca9efa6c6f0e51c8f3670c4 to your computer and use it in GitHub Desktop.
Save Joe1220/76daadc29ca9efa6c6f0e51c8f3670c4 to your computer and use it in GitHub Desktop.
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