- From: Jake Archibald <notifications@github.com>
- Date: Mon, 13 May 2019 13:18:53 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 13 May 2019 20:19:16 UTC
fwiw
```js
function anySignal(...signals) {
const controller = new AbortController();
function onAbort() {
controller.abort();
// Cleanup
for (const signal of signals) {
signal.removeEventListener('abort', onAbort);
}
}
for (const signal of signals) {
if (signal.aborted) {
onAbort();
return;
}
signal.addEventListener('abort', onAbort);
}
return controller.signal;
}
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/905#issuecomment-491970649
Received on Monday, 13 May 2019 20:19:16 UTC