JSPM

@jswork/next-cancelable-fetch

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q14094F
  • License MIT

Cancelable fetch for next.

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.

version license size download

installation

npm install -S @jswork/next-cancelable-fetch

usage

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.