Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

best place for create actions #65

Closed
tadjik1 opened this issue Aug 19, 2015 · 1 comment
Closed

best place for create actions #65

tadjik1 opened this issue Aug 19, 2015 · 1 comment

Comments

@tadjik1
Copy link

tadjik1 commented Aug 19, 2015

Hi. I am using redux and react-redux bindings for it and have the problem with getting right state when component just mount. The problem is: I can't start action before first render:

class HomePage extends Component {
  ...
  componentWillMount() {
    this.props.fetchMovies({type: free, limit: 10});
  }

  render() {
     const { movies } = this.props;
     // right now movies.isFetching = false;
  }
}

export default connect(selectMovies, bindActions)(HomePage);

I want that at the first render I see that movies already fetching, how could I do this?

@tadjik1
Copy link
Author

tadjik1 commented Aug 19, 2015

Ok, I see your example, http://rackt.github.io/redux/docs/advanced/ExampleRedditAPI.html, you always check no only fetching flag but count of elemets too. It's look good, I'll use the same technic.

@tadjik1 tadjik1 closed this as completed Aug 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant