Search e01
One query across the encyclopedia, books, dictionary, papers, Wikidata and the developer library. Every hit carries its source.
6 results across 6 corpora for DisposableStack.prototype.disposed.
Developer library 6
AsyncDisposableStack
The **`AsyncDisposableStack`** object represents a stack of [async disposers](/docs/Web/JavaScript/Reference/Statements/await_using) to run when the stack itself is disposed. Disposer functions are executed in reverse order of registration, with strong error handling guarantees. Calling its `move()` method will transfer responsibility for calling the current registered disposers to a new `AsyncDisposableStack` and pr
AsyncDisposableStack.prototype.defer()
The **`defer()`** method of AsyncDisposableStack instances takes a callback function to be called and awaited when the stack is disposed. See DisposableStack.prototype.defer() for general information about the `defer()` method. ## Syntax ```js-nolint defer(onDispose) ``` ### Parameters - `onDispose` - : A function that will be called when the stack is disposed. The function receives no arguments and can return
AsyncDisposableStack.prototype.adopt()
The **`adopt()`** method of AsyncDisposableStack instances registers a value that doesn't implement the async disposable protocol to the stack by providing a custom disposer function. See DisposableStack.prototype.adopt() for general information about the `adopt()` method. ## Syntax ```js-nolint adopt(value, onDispose) ``` ### Parameters - `value` - : Any value to be registered to the stack. - `onDispose` -
AsyncDisposableStack.prototype.use()
The **`use()`** method of AsyncDisposableStack instances registers a value that implements the [async disposable protocol](/docs/Web/JavaScript/Guide/Resource_management) to the stack. See DisposableStack.prototype.use() for general information about the `use()` method. ## Syntax ```js-nolint use(value) ``` ### Parameters - `value` - : The value to register to the stack. Must either contain a `[Symbol.asyncDis
DisposableStack
The **`DisposableStack`** object represents a stack of [disposers](/docs/Web/JavaScript/Reference/Statements/using) to run when the stack itself is disposed. Disposer functions are executed in reverse order of registration, with strong error handling guarantees. Calling its `move()` method will transfer responsibility for calling the current registered disposers to a new `DisposableStack` and prevent registering any
DisposableStack.prototype.defer()
The **`defer()`** method of DisposableStack instances takes a callback function to be called when the stack is disposed. ## Syntax ```js-nolint defer(onDispose) ``` ### Parameters - `onDispose` - : A function that will be called when the stack is disposed. The function receives no arguments. ### Return value None (undefined). ### Exceptions - TypeError - : Thrown if `onDispose` is not a function. - Refere