Options
All
  • Public
  • Public/Protected
  • All
Menu
since

1.0.0

Hierarchy

  • ContextManager

Index

Methods

  • bind<T>(context: Context, target: T): T
  • Bind an object as the current context (or a specific one)

    Type Parameters

    • T

    Parameters

    • context: Context
    • target: T

      Any object to which a context need to be set

    Returns T

  • with<A, F>(context: Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>
  • Run the fn callback with object set as the current active context

    Type Parameters

    • A extends unknown[]

    • F extends ((...args: A) => 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

    • Rest ...args: A

      optional arguments forwarded to fn

    Returns ReturnType<F>

Generated using TypeDoc