p-memoize

Memoize promise-returning & async functions

MIT License

Downloads
4M
Stars
373
Committers
14

Bot releases are hidden (Show)

p-memoize - Latest Release

Published by sindresorhus about 2 years ago

  • Add missing dependency when used with TypeScript 00faae0

https://github.com/sindresorhus/p-memoize/compare/v7.1.0...v7.1.1

p-memoize -

Published by sindresorhus over 2 years ago

  • Allow the cache to be disabled (#49) d4dabbe

https://github.com/sindresorhus/p-memoize/compare/v7.0.0...v7.1.0

p-memoize -

Published by sindresorhus over 2 years ago

Breaking

Improvements

  • Allow .set() method used in the cache option to be async (#48) 7a82e0f
  • Synchronously cache pending promises (#48) 7a82e0f

https://github.com/sindresorhus/p-memoize/compare/v6.0.2...v7.0.0

p-memoize -

Published by sindresorhus over 2 years ago

  • Export missing TypeScript types (#45) aff13bb

https://github.com/sindresorhus/p-memoize/compare/v6.0.1...v6.0.2

p-memoize -

Published by sindresorhus almost 3 years ago

p-memoize -

Published by sindresorhus about 3 years ago

  • Only use internal promise cache if a value already exists in cache (#32) 873390d

https://github.com/sindresorhus/p-memoize/compare/v6.0.0...v6.0.1

p-memoize -

Published by sindresorhus about 3 years ago

Breaking

  • Remove maxAge option 19b418e
    • For a custom cache, this means instead of .set() being provided an object with the properties value and maxAge, it will only be provided value as the first argument.
    • How to preserve max age functionality.

Improvements

  • The custom cache can now be async by returning a promise in the .get() and .has() cache methods
  • Promises returned from a memoized function will be cached internally and take priority over cache. The promise cache does not persist outside of the current instance and properties assigned to a returned promise will not be kept. The custom cache will be provided the values of resolved promises instead of the promises themselves.

https://github.com/sindresorhus/p-memoize/compare/v5.0.1...v6.0.0

p-memoize -

Published by sindresorhus about 3 years ago

  • Fix TypeScript type of optional custom cache (#27) 733e324

https://github.com/sindresorhus/p-memoize/compare/v5.0.0...v5.0.1

p-memoize -

Published by sindresorhus about 3 years ago

Breaking

  • Require Node.js 12.20 d95278e
  • This package is now pure ESM. Please read this.
  • pMemoize.clear() is now a named export called pMemoizeClear

Fixes

  • Fix consecutive non awaited calls (#25) 343ac6e

https://github.com/sindresorhus/p-memoize/compare/v4.0.2...v5.0.0

p-memoize -

Published by sindresorhus about 3 years ago

  • Fix maxAge to start on Promise settlement (#24) 49a4db9

https://github.com/sindresorhus/p-memoize/compare/v4.0.1...v4.0.2

p-memoize -

Published by sindresorhus about 4 years ago

p-memoize -

Published by sindresorhus over 4 years ago

Breaking

  • Require Node.js 10 d11b692

Breaking for TypeScript users

  • Only use a CommonJS export for the TypeScript definition (reason)
    You need to change import pMemoize from 'p-memoize'; to import pMemoize = require('p-memoize');

Enhancements

  • Add cachePromiseRejection option (#13) cca1cf6

https://github.com/sindresorhus/p-memoize/compare/v3.1.0...v4.0.0

p-memoize -

Published by sindresorhus over 5 years ago

  • Refactor TypeScript definition to CommonJS compatible export (#8) 335d165

https://github.com/sindresorhus/p-memoize/compare/v3.0.0...v3.1.0

p-memoize -

Published by sindresorhus over 5 years ago

Breaking:

  • The .clear() method now throws if you try to clear non-memoized functions (#7) eb5829f

Enhancements:

  • Add TypeScript definition (#7) eb5829f

https://github.com/sindresorhus/p-memoize/compare/v2.1.0...v3.0.0