1.0.12 • Published 2 years ago

@jswork/next-fetch-with-cancelable v1.0.12

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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.

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

3 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago