Skip to content

Commit ebec172

Browse files
committed
Add support for AbortController (developit#54)
1 parent 5556015 commit ebec172

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ export default typeof fetch=='function' ? fetch.bind() : function(url, options)
1515
resolve(response());
1616
};
1717

18+
if (options.signal) options.signal.onabort = () => request.abort();
19+
20+
request.onabort = reject;
21+
1822
request.onerror = reject;
1923

2024
request.send(options.body);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy