Skip to content

Is the error reset during an AbortError redundant? #4

@BenMcH

Description

@BenMcH

if (error.name === "AbortError") {
setError(null);
setData(null);
}

Thanks for putting this test suite together! After completing the useFetch hook, I went back and compared my solution to the committed solution and noticed that this was the one functionality deviation between what I wrote and the expected solution. I would expect that this setError(null) is not actually needed, as the error is set to null at the top of the hook on line 91.

I may be missing an edge case, but the test suite didn't appear to be affected by the absence of that line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions