Created
October 25, 2016 17:06
-
-
Save eLafo/302a34483b897aa22a6ff5cbeb7e7e41 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
// a functional component. Also named container | |
import {createStructuredSelector} from 'reselect'; | |
import { bindActionCreators } from 'redux' | |
import { connect }from 'react-redux' | |
import {App} from '../components/App' | |
import {getAppUIState} from '../selectors'; | |
import * as actions from '../actions'; | |
const mapDispatchToProps = dispatch => ({ | |
actions: bindActionCreators(actions, dispatch) | |
}) | |
const mapStateToProps = createStructuredSelector({ | |
app: getAppUIState | |
}) | |
const AppContainer = connect( | |
mapStateToProps, | |
mapDispatchToProps | |
)(App) | |
export default AppContainer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment