stats-map
Install
$ npm install --save stats-map
Usage
const StatsMap = ;const mem = ; let i = 0;const counter = ++i; const cache = ;const memoized = ; ;//=> 1 // cached as it's the same argument;//=> 1 // not cached anymore as the argument changed;//=> 2 ;//=> 2 console;//=> {hits: 2, misses: 2}
API
StatsMap([iterable])
Inherits from Map.
.stats
Type: object
The statistics of the map like the hits
and misses
.
Related
- mem - Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input.
License
MIT © Sam Verschueren