@esfx/cancelable-dom-shim
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@esfx/cancelable-dom-shim

The @esfx/cancelable-dom-shim package provides a global shim to make the DOM AbortController and AbortSignal classes compatible with @esfx/cancelable.

Overview

Installation

npm i @esfx/cancelable-dom-shim

Usage

The global shim adds a default implementation the collection interfaces to the following global DOM objects:

  • AbortController implements:
    • CancelableSource
    • Cancelable
  • AbortSignal implements:
    • Cancelable

To install the global shim, import @esfx/cancelable/global:

import "@esfx/cancelable-dom-shim"; // triggers global-scope side effects
import { Cancelable } from "@esfx/cancelable";

const abortController = new AbortController();
const signal = abortController[Cancelable.cancelSignal]();

Readme

Keywords

none

Package Sidebar

Install

npm i @esfx/cancelable-dom-shim

Weekly Downloads

1

Version

1.0.0

License

Apache-2.0

Unpacked Size

22 kB

Total Files

8

Last publish

Collaborators

  • rbuckton