Takaro - v0.4.11
    Preparing search index...

    Variable memoize

    memoize: {
        Cache: MapCacheConstructor;
        <T extends (...args: any) => any>(
            func: T,
            resolver?: (...args: Parameters<T>) => any,
        ): T & MemoizedFunction;
    }

    Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for storing the result based on the arguments provided to the memoized function. By default, the first argument provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with the this binding of the memoized function.

    Type Declaration

      • <T extends (...args: any) => any>(
            func: T,
            resolver?: (...args: Parameters<T>) => any,
        ): T & MemoizedFunction
      • Type Parameters

        • T extends (...args: any) => any

        Parameters

        • func: T

          The function to have its output memoized.

        • Optionalresolver: (...args: Parameters<T>) => any

          The function to resolve the cache key.

        Returns T & MemoizedFunction

        Returns the new memoizing function.

    • Cache: MapCacheConstructor