@squareys/webdecks-sdk - v0.0.0
    Preparing search index...

    Class HandleCache<T, H>

    A sparse, per-collection cache keyed by wasm handle. HandleCache.wrap lazily builds a wrapper the first time a handle is seen and returns that same instance ever after, so lookups are an array index (not a map hash) and identity is preserved. A null handle maps to null, which the type system then forces the caller to check.

    Type Parameters

    Index
    • Wrap a handle, reusing the existing wrapper; returns null for the null handle.

      Parameters

      • index: number

      Returns T | null

    • Return the cached wrapper for a handle without creating one.

      Parameters

      • index: number

      Returns T | null

    • Invalidate and drop the wrapper for a handle, so a later reuse of the handle is clean.

      Parameters

      • index: number

      Returns void

    • Invalidate and drop every cached wrapper (e.g. when the document is replaced).

      Returns void