@qbraid-core
    Preparing search index...

    Function using

    • Utility function to handle resource management similar to Python's context manager

      Type Parameters

      • T extends Disposable
      • R

      Parameters

      • resource: T & { init(): Promise<void> }

        A disposable resource with init and dispose methods

      • fn: (resource: T) => Promise<R>

        The function to execute with the managed resource

      Returns Promise<R>