Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/masad-frost/abort-signal-any


https://github.com/masad-frost/abort-signal-any

Last synced: 14 days ago
JSON representation

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');
```