Skip to content

arturparkhisenko/fetch-request

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fetch-request

Cancellable Fetch Request using AbortController and AbortSignal. ESM. No dependencies.

Example:

import { fetchRequest } from 'fetch-request';

let request = fetchRequest('http://httpstat.us/200?sleep=1000');

request
  .then(result => {
    console.log('✅ Resolved');
  })
  .catch(error => {
    console.log('❌ Rejected');
  });

setTimeout(() => request.cancel(), 10);
// ❌ Rejected

Support: Can I use AbortController and AbortSignal?

abortcontroller

About

Cancellable Fetch Request, ESM.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published