Skip to content

Abort fetch requests when component is removed #2598

@maxpatiiuk

Description

@maxpatiiuk

When a component is removed before a network request is resolved, or an old request is replaced with a new one, the old request should be canceled. This would reduce wasted network bandwidth and reduce load on the back-end server.

Here is how to tell fetch to abort the request - https://developer.mozilla.org/en-US/docs/Web/API/AbortController/signal
Potentially, that could be integrated into the useAsyncState hook since that's where most network requests are made from on the front-end

Metadata

Metadata

Assignees

No one assigned

    Labels

    1 - RequestA request made by a member of the community

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions