AsyncDisposableStack - JavaScript | MDN
Constructor
AsyncDisposableStack()-
Creates a new
AsyncDisposableStackobject.
Instance properties
These properties are defined on AsyncDisposableStack.prototype and shared by all AsyncDisposableStack instances.
AsyncDisposableStack.prototype.constructor-
The constructor function that created the instance object. For
AsyncDisposableStackinstances, the initial value is theAsyncDisposableStackconstructor. AsyncDisposableStack.prototype.disposed-
Read-only. Returns
trueif theAsyncDisposableStackhas been disposed, orfalseif not. AsyncDisposableStack.prototype[Symbol.toStringTag]-
The initial value of the
[Symbol.toStringTag]property is the string"AsyncDisposableStack". This property is used inObject.prototype.toString().
Instance methods
AsyncDisposableStack.prototype.adopt()-
Registers a value that doesn't implement the async disposable protocol to the stack by providing a custom disposer function.
AsyncDisposableStack.prototype.disposeAsync()-
Disposes this stack by calling all disposers registered to it in reverse order of registration.
AsyncDisposableStack.prototype.defer()-
Takes a callback function to be called when the stack is disposed.
AsyncDisposableStack.prototype.move()-
Creates a new
AsyncDisposableStackinstance that contains the same disposers as this stack, and then marks this stack as disposed, without calling any disposers. AsyncDisposableStack.prototype.use()-
Registers a value that implements the async disposable protocol to the stack.
AsyncDisposableStack.prototype[Symbol.asyncDispose]-
An alias for the
disposeAsync()method.
Specifications
| Specification |
|---|
| ECMAScript Async Explicit Resource Management # sec-asyncdisposablestack-objects |