Re: [whatwg/dom] Expose an `aborted` promise on AbortSignal? (#946)

> I’d be curious about an example scenario where “all” is needed. I’m sure such cases exist, but I’m having trouble imagining one.

The use-cases are much more limited than for `race(..)`, but I included `signalAll(..)` in large part for completeness-sake.

However, there was *one* use-case I came across and was glad I had it: an app where multiple operations can be initiated/running at a given time, and each one can either complete or be canceled independent of the others. If you cancel (or timeout) *all* of them, the whole state of the application is treated as "reset", but if some of them are able to complete, you don't reset, you just proceed.

`signalAll(..)` conveniently composed the "all of them were canceled" condition in that case. IOW, use-cases like "do W only if all of X, Y, and Z timeout", etc.

-- 
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/dom/issues/946#issuecomment-845964596

Received on Friday, 21 May 2021 13:51:11 UTC