Last active
October 5, 2016 10:16
-
-
Save mattiamanzati/76ea9c266ce7bd08cd81054b05545148 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 as reduxConnect} from 'react-redux' | |
| export const connect = (mapStateToProps = defaultMapStateToProps, reduxMapDispatch, reduxMergeProps, options) => | |
| BaseComponent => { | |
| const reduxMapState = (state, props) => | |
| mapStateToProps(props.selector(state), props, state) | |
| const ReduxComponent = reduxConnect( | |
| reduxMapState, | |
| reduxMapDispatch, | |
| reduxMergeProps, | |
| options | |
| )(BaseComponent) | |
| return withLocalSelector(ReduxComponent) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment