Slide 22
Slide 22 text
Redux connect
//./src/containers/NewsFeedSocialScreen.js
class NewsFeedSocialScreen extends React.Component {}
function mapStateToProps(state) {
return {
isFetching: state.getIn(['newsFeed', 'socialFeed', 'isFetching']),
error: state.getIn([‘newsFeed’, 'socialFeed', 'error']),
lastUpdate: state.getIn(['newsFeed', 'socialFeed', 'lastUpdate']),
posts: state.getIn(['newsFeed', 'socialFeed', 'posts']).toJS()
};
}
export default connect(mapStateToProps)(NewsFeedSocialScreen);