跳到主要内容
版本:Next

AsyncContextManager

Index

Methods

active

  • Get the current active context

bind

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


    Type parameters

    • T

disable

  • Disable context management

enable

  • Enable context management

with

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


    Type parameters

    • A: unknown[]
    • F: (...args: A) => ReturnType<F>