AsyncDisposeAggregator is a utility class that allows you to add multiple items and then dispose them all at once.
The items are disposed one by one in the order they were added.
You can add a function to call, an object with a dispose method, an object with a Symbol.dispose method,
an object with a Symbol.asyncDispose method, or a Promise that resolves to one of the previous types.
To dispose all the items, call dispose or use the Symbol.asyncDispose symbol.
The difference between AsyncDisposeAggregator and DisposeAggregator is that AsyncDisposeAggregator can dispose async targets.
AsyncDisposeAggregator
is a utility class that allows you to add multiple items and then dispose them all at once. The items are disposed one by one in the order they were added. You can add a function to call, an object with adispose
method, an object with aSymbol.dispose
method, an object with aSymbol.asyncDispose
method, or a Promise that resolves to one of the previous types. To dispose all the items, calldispose
or use theSymbol.asyncDispose
symbol. The difference betweenAsyncDisposeAggregator
andDisposeAggregator
is thatAsyncDisposeAggregator
can dispose async targets.For example,