Closed
Description
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.