Async Explicit Resource Management
Less than 1 minute
Async Explicit Resource Management
Note
This is only built-ins for this proposal, using
syntax support requires transpiler support.
Modules
esnext.symbol.async-dispose
esnext.async-disposable-stack.constructor
esnext.async-iterator.async-dispose
Types
interface SymbolConstructor {
readonly asyncDispose: unique symbol;
}
class AsyncDisposableStack {
constructor();
disposeAsync(): Promise<void>;
use<T = AsyncDisposable | Disposable>(value: T): T;
adopt<T>(value: T, onDispose: (value: T) => void | Promise<void>): T;
defer(onDispose: Function): void;
[Symbol.asyncDispose](): Promise<void>;
[Symbol.toStringTag]: "AsyncDisposableStack";
}
interface AsyncDisposable {
[Symbol.asyncDispose](): Promise<void>;
}
Entry points
core-js/proposals/async-explicit-resource-management
core-js(-pure)/full/symbol/async-dispose
core-js(-pure)/full/async-disposable-stack
core-js(-pure)/full/async-iterator/async-dispose