@akshay-nm/custom-fetch

1.0.2 • Public • Published

Custom Fetch

A wrapper over window.fetch.

usage

yarn add @akshay-nm/custom-fetch

This one attaches an abort signal on window.fetch, and adds a timeout (can be configured by passing a timeoutDuration param).

Parameters supported:

  • url
  • timeoutDuration
  • method
  • headers
  • body
  • mode
  • credentials
  • cache
  • redirect
  • referrer
  • integrity

Returns an object with following properties:

  • send: () => Promise
  • abort: () => Promise

Package Sidebar

Install

npm i @akshay-nm/custom-fetch

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

11.2 kB

Total Files

15

Last publish

Collaborators

  • akshay-nm