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

Example of route data resolution? #59

Open
ninjasort opened this issue Sep 1, 2016 · 4 comments
Open

Example of route data resolution? #59

ninjasort opened this issue Sep 1, 2016 · 4 comments

Comments

@ninjasort
Copy link

ninjasort commented Sep 1, 2016

Angular has a concept in it's ui.router you may know, resolve. I'm wondering if you would recommend doing that for react router, loading all data for a route using onEnter or using your componentWillMount..? Do you know the scalability of each?

@r-park
Copy link
Owner

r-park commented Sep 4, 2016

From what I've read the react-router devs discourage using onEnter to fetch data. From my own experience, it's not a very nice fit within a redux workflow.

I generally dispatch actions from one of the component life-cycle methods, and rely on redux-saga or redux-observable to handle the async life-cycle (pending, fetch, fulfilled, failed).

@ninjasort
Copy link
Author

@r-park Thanks for the clarification. It doesn't look like your using react-saga within this example. Would you be open to a PR or adding that in?

@r-park
Copy link
Owner

r-park commented Sep 5, 2016

@cameronroe the redux-saga version is here

@ninjasort
Copy link
Author

Awesome. Any recommended pieces on learning Saga? Seems like a few new concepts here. Thanks!

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

2 participants