@azure/abort-controller package

Classes

AbortError

This error is thrown when an asynchronous operation has been aborted. Check for this error by testing the name that the name property of the error matches "AbortError".

Example

const controller = new AbortController();
controller.abort();
try {
  doAsyncWork(controller.signal)
} catch (e) {
  if (e.name === 'AbortError') {
    // handle abort error here.
  }
}

Interfaces

AbortSignalLike

Allows the request to be aborted upon firing of the "abort" event. Compatible with the browser built-in AbortSignal and common polyfills.