• function will execute a passed in function passing in the supplied Disposable and then calling the dispose method on the Disposable when execution of the function is done. Usage Example:

    await using(new ImplementsDisposable(), async (disposable) => {
    await disposable.interact();
    // do stuff...
    }); // `disposable.dispose` is called here

    Type Parameters

    Parameters

    • disposable: T

      object implementing the Disposable interface

    • func: Func<T, void | Promise<void>>

      a function to be passed the Disposable for use before disposal

    Returns Promise<void>

Generated using TypeDoc