- From: Jake Archibald <notifications@github.com>
- Date: Fri, 10 Feb 2023 03:55:58 -0800
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 10 February 2023 11:56:10 UTC
fwiw, it can be simplified further:
```ts
function anySignal(signals: AbortSignal[]) {
const controller = new AbortController();
for (const signal of signals) {
if (signal.aborted) return signal;
signal.addEventListener("abort", () => controller.abort(signal.reason), {
signal: controller.signal,
});
}
return controller.signal;
}
```
…now that signals can be used to remove event listeners.
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/905#issuecomment-1425708260
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/fetch/issues/905/1425708260@github.com>
Received on Friday, 10 February 2023 11:56:10 UTC