How to use the abortcontroller-polyfill/dist/cjs-ponyfill.js.abortableFetch function in abortcontroller-polyfill

To help you get started, we’ve selected a few abortcontroller-polyfill examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github waitingsong / rxxfetch / packages / rxxfetch / src / lib / config.ts View on Github external
keepRedirectCookies: false,
  method: 'GET',
  processData: true,
  timeout: null,

  cache: 'default',
  credentials: 'same-origin',
  mode: 'cors',
  redirect: 'follow',
  referrer: 'client',
}

// for node.js
if (typeof window === 'undefined') {
  if (typeof fetch !== 'function') {
    initialRxRequestInit.fetchModule = abortableFetch(_fetch).fetch
  }

  if (typeof Headers !== 'function') {
    initialRxRequestInit.headersInitClass = _Headers
  }
}


export const httpErrorMsgPrefix = 'Fetch error status:'

abortcontroller-polyfill

Polyfill/ponyfill for the AbortController DOM API + optional patching of fetch (stub that calls catch, doesn't actually abort request).

MIT
Latest version published 2 years ago

Package Health Score

70 / 100
Full package analysis

Similar packages