Skip to content

Releases: sindresorhus/memoize

v6.0.0

11 Nov 09:30
Compare
Choose a tag to compare

Breaking

  • Simplify the default cacheKey (#43) b7a0766
    It now defaults to cacheKey: x => x instead of the much more complicated previous default. This means it will now only cache the first argument, and only if it's a primitive. Previously, it tried to cache all arguments using JSON.stringify(), but this was both error-prone and slow. This change makes the memoization logic very straightforward, explicit and fast by default. See the readme for how to handle multi-argument or non-primitive value situations.
  • Drop the cachePromiseRejection option (#43) b7a0766
    It was not a good fit for mem and we plan to add it to p-memoize instead (sindresorhus/p-memoize#11), which is like mem, but focused on promises.
  • Throw when .clear() is called with a non-memoized function (#44) c73c23b

v5.1.1...v6.0.0

v5.1.1

29 Jun 20:06
Compare
Choose a tag to compare
  • Always use an object for the cache item to match expectations and the TypeScript definitions (#42) 1f38c3e

v5.1.0...v5.1.1

v5.1.0

15 Jun 13:15
Compare
Choose a tag to compare

Enhancements:

v5.0.0...v5.1.0

v5.0.0

17 May 17:28
Compare
Choose a tag to compare

Breaking:

  • Require Node.js 8 e54b59b
  • Change the default value of the cachePromiseRejection option to true (#36) 70707ae
    We decided it's better to default to the least surprising/magic behavior.

Breaking for TypeScript users:

  • Only use a CommonJS export for the TypeScript definition
    You need to change import mem from 'mem'; to import mem = require('mem');

Enhancements:

  • Cache function reference when it's a single argument (#35) 10f13c0

v4.3.0...v5.0.0

v4.3.0

31 Mar 19:09
Compare
Choose a tag to compare
  • Refactor TypeScript definition to use CJS compatible export (#32) 9a432b9
  • TypeScript - Fix the cache type (#29) 298a71e

v4.2.0...v4.3.0

v4.2.0

12 Mar 17:42
Compare
Choose a tag to compare

v4.1.0...v4.2.0

v4.1.0

30 Jan 08:47
Compare
Choose a tag to compare
  • Work around some host environments throwing on mimicFn call (#26) e08ad85
  • Bump dependencies bdfc93a

v4.0.0...v4.1.0