mo / abortcontroller-polyfill

Polyfill for the AbortController DOM API and abortable fetch (stub that calls catch, doesn't actually abort request).
MIT License
328 stars 26 forks source link

The Request constructor should copy the signal from the init argument #8

Closed rmja closed 6 years ago

rmja commented 6 years ago

Something along this:

            const nativeProto = Request.prototype;
            const NativeRequest = Request;
            Request = function (input, init) {
                let request = new NativeRequest(input, init);
                if (init && init.signal) {
                    request.signal = init.signal;
                }
                return request;
            }
            Request.prototype = nativeProto;