Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SingularCLS<Context>

A trivial implementation of continuation-local storage where everything is in the same continuation. Therefore, only one unique value can be stored at a time.

Type parameters

  • Context

Hierarchy

  • SingularCLS

Implements

Index

Constructors

constructor

  • new SingularCLS(defaultContext: Context): SingularCLS

Methods

bindWithCurrentContext

  • bindWithCurrentContext<T>(fn: Func<T>): Func<T>

disable

  • disable(): void

enable

  • enable(): void

getContext

  • getContext(): Context

isEnabled

  • isEnabled(): boolean

patchEmitterToPropagateContext

  • patchEmitterToPropagateContext(ee: EventEmitter): void

runWithContext

  • runWithContext<T>(fn: Func<T>, value: Context): T

Generated using TypeDoc