Endo API documentation
    Preparing search index...

    Function makeCacheMapKit

    • Create a bounded-size cache having WeakMap-compatible has/get/set/delete methods, capable of supporting SES (specifically assert error notes). Key validity, comparison, and referential strength are controlled by the makeMap option, which defaults to WeakMap but can be set to any producer of objects with those methods (e.g., using Map allows for arbitrary keys which will be strongly held). Cache eviction policy is not currently configurable, but strives for a hit ratio at least as good as LRU (e.g., it might be CLOCK or SIEVE).

      Type Parameters

      • C extends MapConstructor | WeakMapConstructor = WeakMapConstructor
      • K extends unknown = Parameters<InstanceType<C>["set"]>[0]
      • V extends unknown = unknown

      Parameters

      Returns CacheMapKit<C, K, V>