JSPM

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

Cancelable fetch middleware for next.

Package Exports

  • @jswork/next-fetch-with-cancelable
  • @jswork/next-fetch-with-cancelable/dist/index.js

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-fetch-with-cancelable) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

next-fetch-with-cancelable

Cancelable fetch middleware for next.

version license size download

installation

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

usage

import '@jswork/next-fetch-with-cancelable';

const cancelableFetch = nx.fetchWithCancelable(fetch);
const fetchResource = cancelableFetch('https://api.github.com/users/afeiship', { cancelable: true })
  .then(res=>res.json())
  .then((res) => {
    console.log('response:', res);
  })
  .catch((err) => {
    console.log(err);
  });

// abort
fetchResource.cancel();

license

Code released under the MIT license.