Closed autarc closed 8 years ago
@svrcekmichal It does. Since the callback is automatically called after all hooks are resolved - the transition applies just like before. The only difference is the execution order which happens as expected and therefore gets the data before calling rendering.
@Autarc thats what I am talking about, @markdalgleish don't want to wait for data. He want component to be rendered without data with loading indicators and then fetch data and re-render
look at this issue
@Autarc I don't think you should use redial for this use case. All you need is little helper function like:
// fetchComponentData.js
export default function fetchComponentData(dispatch, components, params) {
const needs = components.reduce( (prev, current) => {
return current ? (current.needs || []).concat(prev) : prev;
}, []);
const promises = needs.map(need => dispatch(need(params)));
return Promise.all(promises);
}
If you search github for 'fetchComponentData', you'll find 5 or 6 repos using this as a resolver.
Sorry, closing this for the same reason as #19.
The updated example solves the previous issue (#13).