@type-cacheable/lru-cache-adapter

Adapter for using lru-cache with type-cacheable

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@type-cacheable/lru-cache-adapter
1091011.0.34 months ago2 years agoMinified + gzip package size for @type-cacheable/lru-cache-adapter in KB

Readme

@type-cacheable/lru-cache-adapter
TypeScript-based caching decorators to assist with caching (and clearing cache for) async methods. This package supports the lru-cache client.
View full documentation

Usage

Installation

npm install --save @type-cacheable/core @type-cacheable/lru-cache-adapter

or
yarn add @type-cacheable/core @type-cacheable/lru-cache-adapter

Using adapter

import * as LRUCache from 'lru-cache';
import { useAdapter } from '@type-cacheable/lru-cache-adapter';

const client = new LRUCache();
const clientAdapter = useAdapter(client);

Then you can rely on the @Cacheable, @CacheUpdate, and @CacheClear decorators from @type-cacheable/core. See core documentation