Re: [whatwg/fetch] Proposal: fetch with multiple AbortSignals (#905)

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