@neutrium/utilities - v3.1.0
    Preparing search index...

    Class WeakCacheRegistry<K, V>

    Lazy values scoped to object identity. Keys are weakly held; no enumeration, size, or deterministic garbage-collection timing is exposed. Factories run synchronously. Thrown failures are not cached; undefined is. Promise values are stored as-is (including rejected promises).

    Type Parameters

    • K extends object
    • V
    Index
    • Existing returned values remain valid; subsequent get calls create new values.

      Returns void

    • Invalidate one key; return whether it had a cached value.

      Parameters

      • key: K

      Returns boolean

    • Return the cached value or create it. Reject recursive creation for the same key.

      Parameters

      • key: K

      Returns V

    • Test whether a value is cached without invoking the factory.

      Parameters

      • key: K

      Returns boolean

    • Read a cached value without invoking the factory; missing keys return undefined.

      Parameters

      • key: K

      Returns V | undefined