cachefactory

Registered as cachefactory in NPM and Bower.

Source:
Examples

Install from NPM

npm i --save cachefactory

Install from Bower

bower i --save cachefactory

Load into your app via script tag

<script src="/path/to/cachefactory.min.js"></script>

Load into your app via CommonJS

var cacheFactory = new require('cachefactory').CacheFactory();

Load into your app via ES2015 Modules

import { CacheFactory } from 'cachefactory';

Load into your app via AMD

define('myApp', ['cachefactory'], function (cachefactory) {
  const cacheFactory = new cachefactory.CacheFactory();
});

Members

(static) BinaryHeap :function

The BinaryHeap constructor function.

Type:
  • function
Source:
See:
Example
import { BinaryHeap, CacheFactory } from 'cachefactory';

(static) Cache :function

The Cache constructor function.

Type:
  • function
Source:
See:
Example
import { Cache, CacheFactory } from 'cachefactory';

(static) defaults :object

The default cache values. Modify this object to change the default values.

Type:
  • object
Source:
See:
Example
import { CacheFactory, defaults } from 'cachefactory';

// Change the default "maxAge" for caches that will be instantiated
// after this point.
defaults.maxAge = 60 * 60 * 1000;

(static) utils :object

Utility functions used throughout this library.

Type:
  • object
Source:
Example
import Promise from 'bluebird';
import { CacheFactory, utils } from 'cachefactory';

// Make this library use your Promise lib
utils.Promise = Promise;