Skip to content

It should be possible to remove event listeners #2087

Closed
@Rychu-Pawel

Description

@Rychu-Pawel

What problem are you trying to solve? Describe the feature.

Currently, there is no way to remove event listeners, e.g., for uploadProgress event.

const ongoingRequestPromise = gotChunkInstance.post(uploadUrl, {
    body: await chunkStreamProvider.getChunkStream() //this is an FS ReadStream
});

const eventListener = (progress: Progress) => {
    console.log(progress);
};

ongoingRequestPromise.on("uploadProgress", eventListener);

setTimeout(() => {
    // This is not possible
    ongoingRequestPromise.removeEventListener("uploadProgress", eventListener);
}, 2000);

Checklist

  • I have read the documentation and made sure this feature doesn't already exist.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions