mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
committed by
John-David Dalton
parent
3b199c30e0
commit
508d46a7a4
@@ -1,5 +1,3 @@
|
|||||||
import MapCache from './.internal/MapCache.js'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that memoizes the result of `func`. If `resolver` is
|
* 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
|
* provided, it determines the cache key for storing the result based on the
|
||||||
@@ -57,10 +55,10 @@ function memoize(func, resolver) {
|
|||||||
memoized.cache = cache.set(key, result) || cache
|
memoized.cache = cache.set(key, result) || cache
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
memoized.cache = new (memoize.Cache || MapCache)
|
memoized.cache = new (memoize.Cache || Map)
|
||||||
return memoized
|
return memoized
|
||||||
}
|
}
|
||||||
|
|
||||||
memoize.Cache = MapCache
|
memoize.Cache = Map
|
||||||
|
|
||||||
export default memoize
|
export default memoize
|
||||||
|
|||||||
Reference in New Issue
Block a user