Takaro - v0.4.11
    Preparing search index...

    Function withScope

    • Creates a new scope with and executes the given operation within. The scope is automatically removed once the operation finishes or throws.

      This is essentially a convenience function for:

      pushScope();
      callback();
      popScope();
      

      Type Parameters

      • T

      Parameters

      Returns T

    • Set the given scope as the active scope in the callback.

      Type Parameters

      • T

      Parameters

      • scope: Scope | undefined
      • callback: (scope: Scope) => T

      Returns T