Guest User

Untitled

a guest
Oct 21st, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import { getAskStories } from '../../redux/stories';
  4. import StoryList from './StoryList';
  5.  
  6. const List = connect(state => ({
  7. data: state.stories.ask,
  8. loading: state.stories.loading.ask
  9. }))(StoryList);
  10.  
  11. class Ask extends React.Component {
  12. componentDidMount() {
  13. this.props.getAskStories();
  14. }
  15. shouldComponentUpdate() {
  16. return false;
  17. }
  18.  
  19. render() {
  20. return <List pullToRefresh={this.props.getAskStories} />;
  21. }
  22. }
  23.  
  24. export default connect(
  25. null,
  26. { getAskStories }
  27. )(Ask);
Add Comment
Please, Sign In to add comment