I am making a website that downloads mp3s from YouTube. I have made a progress bar using event source. I create these listeners to make progress bars? How do I terminate one early (if a user makes a new request).
mp4EventSource = new EventSource(`/${id}/mp4Event`);
function getVidProgress () {
mp4EventSource.addEventListener(`progress${id}`, updateMp4Data);
return () => mp4EventSource.close();
};