kiss-cache
v1.0.9
Published
Key-value cache layer with custom stores
Downloads
26
Readme
KISSCache
Usage
import Cache from 'kiss-cache';
const cache = new Cache();
const someLongExcecutableFunction = async ({hello}) => {
// Some long calculations
return "world";
};
const cachedLongExcecutableFunction = cache.decorate(someLongExcecutableFunction);
// Calculated
cachedLongExcecutableFunction.then(world => console.log(world));
// Use cached value
cachedLongExcecutableFunction.then(world => console.log(world));