Skip to content

Commit

Permalink
Replace MapCache by Map in memoize (lodash#4094) (lodash#4095)
Browse files Browse the repository at this point in the history
  • Loading branch information
blikblum authored and jdalton committed Dec 1, 2018
1 parent 3b199c3 commit 508d46a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions memoize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import MapCache from './.internal/MapCache.js'

/**
* 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
Expand Down Expand Up @@ -57,10 +55,10 @@ function memoize(func, resolver) {
memoized.cache = cache.set(key, result) || cache
return result
}
memoized.cache = new (memoize.Cache || MapCache)
memoized.cache = new (memoize.Cache || Map)
return memoized
}

memoize.Cache = MapCache
memoize.Cache = Map

export default memoize

0 comments on commit 508d46a

Please sign in to comment.