A convenient class to manage global variables.

Hierarchy

  • GlobalRegistry

Constructors

Properties

storage: AsyncLocalStorage<Collection<GlobalRegistrant>> = ...

Methods

  • Retrieve the value of the given key, if it exists in the store.

    Parameters

    • key: string | symbol

    Returns any

  • Run a closure with a global registry.

    Type Parameters

    • T

    Parameters

    • closure: (() => T)
        • (): T
        • Returns T

    Returns T