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. Its creation may be customized by replacing the memoize.Cache
constructor with one whose instances implement the
Map
method interface of clear, delete, get, has, and set.
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. Its creation may be customized by replacing thememoize.Cache
constructor with one whose instances implement theMap
method interface ofclear
,delete
,get
,has
, andset
.Since
5.2.0
Example