The fetch API has a failed state, but if you are using the Marty containers then there is no way to get the parts of the fetch that succeeded on a failed fetch (like there is with pending). This would be very useful if you are fetching several items for one page, passing them down as props, and you rely on part of the data even if some other part has failed.
Perhaps adding the fetch result to the callback here as an optional second parameter (besides just error) would provide a workable API?
I assume current limitation comes from the behavior of getFetchResult; it looks like as soon as there is any fetch result in error it does not add any results, and I'm also not sure if the container would wait for other fetches if one goes into error right away.
How hard would this be to add?
The fetch API has a
failedstate, but if you are using the Marty containers then there is no way to get the parts of the fetch that succeeded on afailedfetch (like there is withpending). This would be very useful if you are fetching several items for one page, passing them down as props, and you rely on part of the data even if some other part has failed.Perhaps adding the fetch result to the callback here as an optional second parameter (besides just
error) would provide a workable API?I assume current limitation comes from the behavior of
getFetchResult; it looks like as soon as there is any fetch result in error it does not add any results, and I'm also not sure if the container would wait for other fetches if one goes into error right away.How hard would this be to add?