moment-cache
Moment-cache is moment.js-depended tool to speed up your application.
During the app lifecycle we can call moment oftentimes. Every call is time. Time is performance. This tool will increase performance of your app by caching moment.js instances.
Why?
; const cache = const dateString = '2016-08-24'; const momentCalls = 99999; const check = { let i = 0; const start = ; while i <= momentCalls ; i++; return - start; } console // ~1588 ms console // ~35 ms
Syntax:
const moment = ; const cache = ; // options is optional const date = ;
Options (optional):
- storage: object where cache data is stored. By default - covert object behind the scenes.