immutable-cache

1.0.2 • Public • Published

Immutable Cache

Configurable cache, based on immutable.js.

Example

import {Cache} from 'immutable-cache';
 
let cache = new Cache({maxSize: 100});
 
// cache key 'key' with value 'value'
cache = cache.set('key', 'value');
 
// check if key is cached
cache.has('key'); // true
cache.has('other-key'); // false
 
cache.get('key'); // 'value'
cache.get('other-key'); // undefined

Options

Name Description
maxSize maximum number of keys stored in cache

License

Immutable-Cache is freely distributable under the terms of the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i immutable-cache

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

13.9 kB

Total Files

14

Last publish

Collaborators

  • filipovsky