diff --git a/src/index.js b/src/index.js index 934c7ce..d330abe 100644 --- a/src/index.js +++ b/src/index.js @@ -15,6 +15,10 @@ export default typeof fetch=='function' ? fetch.bind() : function(url, options) resolve(response()); }; + if (options.signal) options.signal.onabort = () => request.abort(); + + request.onabort = reject; + request.onerror = reject; request.send(options.body);