Changelog
5.2.3
BUGFIXES
5.2.2
was supposed to fix (appreciate the persistence @vlad-zhukov)Changelog
5.2.2
BUGFIXES
cache
would not clear / remove the expiration timeoutChangelog
5.2.1
BUGFIXES
Object.assign
usage on functions (derp)Changelog
5.2.0
NEW FEATURES
collectStats
as a convenience method on the main moize
objectBUGFIXES
moize
d function (isCollectingStats
now, was mistakenly collectStats
before)Changelog
5.1.2
BUGFIXES
micro-memoize
(isMatchingKey) instead of moize
(matchesKey) for instance methods (oops)Changelog
5.1.1
BUGFIXES
matchesKey
optionChangelog
5.1.0
NEW FEATURES
matchesKey
optionisSerialized
to use matchesKey
with custom isMatchingKey
instead of standard isEqual
BUGFIXES
isDeepEqual
from being passed to the micro-memoize
optionsChangelog
5.0.0
micro-memoize
under the hood (doubles the speed, and allows for more functionality)BREAKING CHANGES
equals
option now uses SameValueZero equality instead of strict equalityequals
option is now performed iteratively on each argument in the key, rather on the key as a whole
matchesKey
option now performs the full-key comparison that equals
did in v4serialize
option has been changed to isSerialized
serializeFunctions
option has been changed to shouldSerializeFunctions
require('moize').default
cache
object has changed
moize.promise
now sets both isPromise
and updateExpire
options (v4 and below only set isPromise
)isPromise
is true
and a maxAge
is applied, the maxAge
now begins when the function is created rather than the resolution of the promise
maxAge
to apply upon resolution, then either set the updateExpire
option or use the moize.promise
convenience methodNEW FEATURES
equals
function (either isDeepEqual
option, or moize.deep
convenience method)profileName
)getStats
will get the stats for the profileName
passed, or if none is passed then gets the global statsisCollectingStats
returns whether stats are being collectedonCacheAdd
will fire when a new entry is added to the cacheonCacheChange
will fire when the cache is added to or the LRU order has changedonCacheHit
will fire when an existing entry in cache is usedBUGFIXES
isPromise
methods that resolved had the values re-wrapped in a new promise, which obfuscated chaining on the method (now the original promise is maintained)json-stringify-safe
)DEPRECATIONS
promiseLibrary
is no longer a supported option (it is no longer needed, as the original promise is now maintained)