You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.
// Fetch both a product and a pageconnectFetchData({mapPropsToAction: ({ productId, parentPath })=>(Promise.all([actions.getProductById(productId),actions.getPageByPath(parentPath)])),mapStateToProps: (state,{ productId, parentPath })=>({product: state.products.byId[productId],page: state.pages.byPath[parentPath],}),})
It's easy to work around this by chaining multiple connectFetchData, but this prevents the actions from being fired in parallel. Ideally one would be allowed to return a Promise, but since we're using mapPropsToRequest to determine loading state this isn't trivial.
I suggest being able to return an array from mapPropsToAction that is dispatched in parallel in the middleware. To compute loading and error state something like this would probably be sufficient:
As of now the following doesn't work:
It's easy to work around this by chaining multiple
connectFetchData
, but this prevents the actions from being fired in parallel. Ideally one would be allowed to return a Promise, but since we're usingmapPropsToRequest
to determine loading state this isn't trivial.I suggest being able to return an array from
mapPropsToAction
that is dispatched in parallel in the middleware. To compute loading and error state something like this would probably be sufficient:The text was updated successfully, but these errors were encountered: