Skip to content

Conversation

@mhofman
Copy link
Owner

@mhofman mhofman commented Nov 1, 2021

Add a static using iterator helper that simplifies scoping the disposal of a single resource to a for-of statement.

Throw when calling the using aggregate instance helper after the instance has been disposed of. Ensures that the resource that was attempted to be added for tracking is disposed of first.


static [Symbol.asyncIterator]() {
/** @type {DisposableAggregate | undefined} */
let res = new (this || Disposable)();
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% refactor I guess, I fixed a previous copy-pasta mistake.

Disposable -> AsyncDisposable

@mhofman mhofman requested a review from kriskowal November 1, 2021 05:07
@kriskowal kriskowal removed their request for review November 29, 2021 23:51
@kriskowal
Copy link
Collaborator

I resigned as a reviewer to be realistic about my availability. I’m sure I don’t object to your moving forward!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants