Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/masad-frost/abort-signal-any
https://github.com/masad-frost/abort-signal-any
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/masad-frost/abort-signal-any
- Owner: masad-frost
- Created: 2024-06-08T03:12:20.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-08-15T23:19:10.000Z (5 months ago)
- Last Synced: 2024-12-19T23:55:08.690Z (20 days ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @ungap/abort-signal-any
A [AbortSignal.any()](https://dom.spec.whatwg.org/#dom-abortsignal-any) polyfill.
```js
import '@ungap/abort-signal-any';
// require('@ungap/abort-signal-any');const combinedSignal = AbortSignal.any([controller1.signal, controller2.signal]);
combinedSignal.addEventListener('abort', () => {
console.log('aborted:', combinedSignal.reason);
});controller1.abort('controller1 aborted');
```