todo-react-redux
todo-react-redux copied to clipboard
Example of route data resolution?
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?
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).
@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?
@cameronroe the redux-saga version is here
Awesome. Any recommended pieces on learning Saga? Seems like a few new concepts here. Thanks!