DetailGridCache

LRU cache for nested detail grid descriptors.

Methods

The following table outlines the methods for the DetailGridCache:

NameParametersReturnsDescription
clear
-
void

Clear all cached entries, invoking destroy hooks before removal.

get
  • key

    : string
  • Retrieve a cached entry without creating a new one. Refreshes the lastAccessed timestamp as a side-effect.


    Params:
  • key: Cache key
  • getOrCreate
  • key

    : string
  • parentData

    : TData
  • nestingDepth

    : number
  • options

    : DetailGridOptions
  • Retrieve a cached entry or create a new one. When reuse is enabled and a matching key exists, the existing entry is returned and its lastAccessed timestamp is refreshed.


    Params:
  • key: Cache key
  • parentData: Parent row data
  • nestingDepth: Nesting depth
  • options: Detail grid configuration
  • getStats
    -
    Object

    Return a snapshot of cache statistics. Useful for diagnostics and tests.

    has
  • key

    : string
  • boolean

    Check whether a cache entry exists for the given key.


    Params:
  • key: Cache key
  • registerDestroyHook
    -
    void

    Register a destroy hook to invoke when an entry is released. Used to release external resources (e.g. timers, subscriptions) tied to the cached entry. Replaces any previously registered hook.

    release
  • key

    : string
  • boolean

    Release the entry for the given cache key, invoking any destroy hook before removing the entry from the cache.


    Params:
  • key: Cache key
  • update
  • key

    : string
  • data

    : unknown[]
  • isLoading

    : boolean
  • error

    : string | null
  • void

    Persist the latest data, loading, and error state for a cached entry. No-op when the key is unknown, ensuring that the cache never mutates state for entries that have already been evicted.


    Params:
  • key: Cache key
  • data: Latest child data set
  • isLoading: Loading state
  • error: Error message or null
  • buildCacheKey
  • parentData

    : unknown
  • nestingDepth

    : number
  • options

    : DetailGridOptions
  • string

    Build a stable cache key for a parent row. The key combines a parent identifier, nesting depth, and a configuration reference so that different option sets produce distinct entries.


    Params:
  • parentData: Parent row data
  • nestingDepth: Current depth in the hierarchy
  • options: Detail grid configuration