Package Exports
- @jswork/next-cancelable-fetch
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jswork/next-cancelable-fetch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
next-cancelable-fetch
Cancelable fetch for next.
installation
npm install -S @jswork/next-cancelable-fetchusage
import '@jswork/next-cancelable-fetch';
const fetchResource = nx
.cancelableFetch('https://api.github.com/users/afeiship', { cancelable: true })
.then(res=>res.json())
.then((res) => {
console.log('response:', res.body);
})
.catch((err) => {
console.log(err);
});
// abort
fetchResource.cancel();license
Code released under the MIT license.