1.0.9 • Published 6 years ago
kiss-cache v1.0.9
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));