Created
September 23, 2016 03:39
-
-
Save ManuelDeLeon/483d07bf99f474c69d015e6b3b2954cc to your computer and use it in GitHub Desktop.
This file contains 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 { setVisibilityFilter } from '../actions' | |
import Link from '../components/Link' | |
const mapStateToProps = (state, ownProps) => ({ | |
active: ownProps.filter === state.visibilityFilter | |
}) | |
const mapDispatchToProps = (dispatch, ownProps) => ({ | |
onClick: () => { | |
dispatch(setVisibilityFilter(ownProps.filter)) | |
} | |
}) | |
const FilterLink = connect( | |
mapStateToProps, | |
mapDispatchToProps | |
)(Link) | |
export default FilterLink |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment