mem v6.0.1 Release Notes

Release Date: 2019-11-29 // 17 days ago
    • 👌 Support overloaded functions (TypeScript types) (#48) 809697d

Previous changes from v6.0.0

  • 💥 Breaking

    • 0️⃣ 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. If you depend on this option, you should stay on mem v5 until sindresorhus/p-memoize#11 is resolved.
    • Throw when .clear() is called with a non-memoized function (#44) c73c23b

    v5.1.1...v6.0.0