My code works fine in modern browsers but doesn't work in IE11. I removed all the lambdas of the expression, but I have problems with that. How can I rewrite this piece of code in ES5 to avoid destructuring?
.then(function(response) {
var reader = response.body.getReader();
return new ReadableStream({
start(controller) {
return pump();
function pump() {
return reader.read().then(function (data) {
if (data.done) {
controller.close();
return;
}
controller.enqueue(data.value);
return pump();
});
}
},
});
})