Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@akshay-nm/custom-fetch

akshay-nm15MIT1.0.2

Wrapper over window.fetch (with abort controller)

fetch, window.fetch, wrapper, custom-fetch, custom fetch, abortable fetch, fetch with abort, nm, nightmoves, akshay

readme

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