@laserware/stasis
    Preparing search index...

    Function lruMemoize

    • Creates a memoized version of a function with an optional LRU (Least Recently Used) cache. The memoized function uses a cache to store computed values. Depending on the maxSize option, it will use either a singleton cache (for a single entry) or an LRU cache (for multiple entries).

      Note: This function was previously known as defaultMemoize.

      Type Parameters

      • Func extends AnyFunction

        The type of the function that is memoized.

      Parameters

      • func: Func

        The function to be memoized.

      • OptionalequalityCheckOrOptions: EqualityFn<any> | LruMemoizeOptions<ReturnType<Func>>

        Either an equality check function or an options object.

      Returns Func & {
          clearCache: () => void;
          resetResultsCount: () => void;
          resultsCount: () => number;
      }

      A memoized function with a .clearCache() method attached.