Skip to content

Partial failures in fetch #346

@idolizesc

Description

@idolizesc

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions