observable icon indicating copy to clipboard operation
observable copied to clipboard

Why not add the .addTeardown method to AbortSignal proper?

Open Jamesernator opened this issue 1 year ago • 0 comments

So on Subscriber we have .addTeardown which adds a convenient way to ensure teardown happens even if the subscriber is already closed. It's not clear to me why though this isn't just added to AbortSignal proper as it just calls the cleanup when subscriber.signal is aborted anyway.

The .addTeardown method would be equally useful in Promise (or callback) usage in basically the same pattern as in Observable so I don't really see a reason to restrict this method to being part of just Observable.

Jamesernator avatar May 11 '24 08:05 Jamesernator