als-unhooked
    Preparing search index...

    Class ALSBase<K, V, S>Protected Abstract

    A base class from which the modern and legacy APIs are both derived.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Instance Methods

    Properties

    Constructors

    Instance Methods

    • Retrieves the current store.

      Returns undefined | S

      The current store or undefined if there is no store.

    • Retrieves a value from the store by key.

      Type Parameters

      • T = V

      Parameters

      • key: K

        The key to retrieve the value for.

      Returns undefined | T

      The value associated with the key, or undefined if the key does not exist.

    • Sets a value in the store by key.

      Type Parameters

      • T = V

      Parameters

      • key: K

        The key to set the value for.

      • value: T

        The value to set.

      Returns void

    • Experimental

      Binds a function to the current store context. Marked experimental as it depends on AsyncLocalStorage.bind

      Type Parameters

      • T extends () => any

      Parameters

      • fn: T

        The function to bind.

      Returns T

      The bound function.

    Properties

    asyncLocalStorage: AsyncLocalStorage<S>