with-cache
with-cache is a simple library that allows you to create with basic composition a function which results will be memoized. You can use cache for any operation from more common like HTTP requests to less like operations that requires heavy computation.
Instalation
npm install --save with-cache
Usage
Simplest case:
; { //...do something}const heavyOperatuionWithCaching = ; //this call will run heavyOperation functionconst result1 = ; //this call return previously cached value const result2 = ;
withCache
can also accept options as a second argument. See docs
; { //...do something}const customKeymaker = arg1 + arg2; {} const heavyOperatuionWithCaching = ;