Skip to content

Return unsubscribe function in fetch implementation #10

@danielrearden

Description

@danielrearden

Right now, there is no way to unsubscribe. If the context changes (for example, we unmount the component that initialized the query), onNext will continue to be called with additional chunks until the request completes. I think it would make sense for the implementation to return an unsubscribe function that could then be used to cancel the network request. For browsers that support it, we can utilize an AbortController and just call abort inside that function.

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