aborter

A minimal reimplementation of AbortController and AbortSignal.

MIT 5 个版本
安装
npm install aborter
yarn add aborter
pnpm add aborter
bun add aborter
README

Aborter

A minimal reimplementation of AbortController and AbortSignal.

This library is only 0.5kb minified, but it's not strictly spec-compliant, if you need that go with abort-controller.

Install

npm install aborter

Usage

import Aborter from 'aborter';

const aborter = new Aborter ();

console.log ( aborter.signal.aborted ); // => false

aborter.signal.addEventListener ( 'abort', () => {

  console.log ( aborter.signal.aborted ); // => true

});

aborter.abort (); // Aborting, causing event handlers to be triggered and the "aborted" property to be set to "true"

License

MIT © Fabio Spampinato

版本列表
3.0.1 2025-01-17
3.0.0 2023-02-11
2.0.0 2022-04-12
1.1.0 2021-07-03
1.0.0 2020-12-29