@launchdarkly/js-server-sdk-common - v2.26.1
    Preparing search index...

    Class TtlCache

    A basic TTL cache with configurable TTL and check interval.

    Index
    • Delete the item with the specific key. If the item does not exist, then there will be no change to the cache.

      Parameters

      • key: string

        The key of the value to delete.

      Returns void

    • Get a value from the cache.

      Parameters

      • key: string

        The key to get a value for.

      Returns any

      The value for the key, or undefined if the key was not added, or if the value has expired.

    • Set an item in the cache. It will expire after the TTL specified in the cache configuration.

      Parameters

      • key: string

        The key for the value.

      • value: any

        The value to set.

      Returns void