Big Fetch
The big-fetch is a wrapper based on fetch and promise, adding abort and timeout functions. If you like it, please give me your star👼. thx~~~🚀
Features
- abort(): Set the current promise to rejected
- timeout: Increase timeout for current request
- onprogress: progress function
Browser Support
The big-fetch is a wrapper based on fetch and promise, If your browser does not support fetch and promise you need to install whatwg-fetch and promise-polyfill
NPM Install
npm install big-fetch --save-exact
Example
A basic fetch request is really simple to set up. Have a look at the following code:
Instead of passing a path to the resource you want to request into the fetch() call, you can create a request object using the Request() constructor, and pass that in as a fetch() method argument:
var myHeaders = var myInit = method: 'GET' headers: myHeaders mode: 'cors' cache: 'default' timeout: 10000 // set 10000ms timeout var request = request // cancelrequest
Issues
☺️Welcome to issues and discuss🌈