Skip to content

katilius/functional-cache-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Functional Cache Redis

Cache provider for functional-cache library.

Usage

const cacheFactory = require('functional-cache');
const RedisProvider = require('functional-cache-redis');

const cache = cacheFactory.createNew(new RedisProvider());
const getBooks = cache.cacheCalls(getBooksFromApi);

Customization

Redis cache provider uses Redis npm library. When creating new CacheProvider instance without params, it initiates new client connecting to localhost:6379. This can by configured simply by providing different client instance to RedisProvider constructor:

const redisClientWithDifferentOptions = getRedisClient();
const cache = cacheFactory.createNew(new RedisProvider(redisClientWithDifferentOptions));
const getBooks = cache.cacheCalls(getBooksFromApi);

About

functional-cache provider using Redis as data source

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published