JSPM

  • Created
  • Published
  • Downloads 5603
  • Score
    100M100P100Q126709F
  • License MIT

Thin wrapper around lru-cache with extended functionality.

Package Exports

  • lru-cache-ext

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lru-cache-ext) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

lru-cache-ext

Build Status Test Coverage Dependabot Status Dependencies NPM Downloads Semantic-Release Gardener

Thin wrapper around lru-cache with extended functionality.

Install

Install with npm:

$ npm install --save lru-cache-ext

Usage

Please refer to lru-cache.

Additions

Some additional, non-invasive functionality is added.

memoize(key: String, valueFn: function)

Only when the key is not present in cache (or has expired), valueFn is called and placed into cache.

The cached value is returned when it becomes available (important in the case where valueFn is async).

The cache is left empty if an error is thrown at any point in valueFn.

Useful when multiple async operation need to access the same async information.