memoize<T>(func, resolver?): T & { cache: Map<any, any>; }
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 used as the map cache key. The func is invoked with the this binding of the memoized function.
Note: The cache is exposed as the cache property on the memoized function.
Differences from lodash:
does not coerce keys to a string; any object can be used as in an ES6 Map
does not let you customize cache creation
Contribution to minified bundle size, when it is the only function imported:
Creates a function that memoizes the result of
func
. Ifresolver
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 used as the map cache key. Thefunc
is invoked with thethis
binding of the memoized function.Note: The cache is exposed as the
cache
property on the memoized function.Differences from lodash:
Map
Contribution to minified bundle size, when it is the only function imported: