Skip to content

Instantly share code, notes, and snippets.

@kdichev
Created April 8, 2018 10:29
Show Gist options
  • Save kdichev/0d1fade1f2e5cce048b1142d2cedde92 to your computer and use it in GitHub Desktop.
Save kdichev/0d1fade1f2e5cce048b1142d2cedde92 to your computer and use it in GitHub Desktop.
import { connect } from "react-redux";
const mapStateToProps = ({
theReducer: { city, humidity, temperature, wind }
}) => ({
city,
humidity,
temperature,
wind
});
const mapDispatchToProps = dispatch => ({
handleMySexyAction: () => dispatch({type: "DO_SEXY_STUFF" }),
});
export default connect(mapStateToProps, mapDispatchToProps)(NAME_OF_COMPONENT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment