Interface ContextManager

Hierarchy

  • ContextManager

Methods

  • Get the current active context

    Returns Context

  • Bind an object as the current context (or a specific one)

    Type Parameters

    • T

    Parameters

    • Optional context: Context

      Optionally specify the context which you want to assign

      Optional
    • target: T

      Any object to which a context need to be set

    Returns T

  • Disable context management

    Returns ContextManager

  • Enable context management

    Returns ContextManager

  • Run the fn callback with object set as the current active context

    Type Parameters

    • A extends unknown[]

    • F extends ((...args) => ReturnType<F>)

    Parameters

    • context: Context

      Any object to set as the current active context

    • fn: F

      A callback to be immediately run within a specific context

    • Optional thisArg: ThisParameterType<F>

      optional receiver to be used for calling fn

      Optional
    • Rest ...args: A

      optional arguments forwarded to fn

      Rest

    Returns ReturnType<F>

Generated using TypeDoc