Synchronous cache interface with events
The type of the cached value
Optional type of the cache key (default is string)
v0.0.8
function foo(cache: ICacheWithEvents<string>) { const value = cache.get('key'); cache.set('key', 'value'); cache.has('key'); // true cache.delete('key'); cache.clear(); cache.size(); // 0} Copy
function foo(cache: ICacheWithEvents<string>) { const value = cache.get('key'); cache.set('key', 'value'); cache.has('key'); // true cache.delete('key'); cache.clear(); cache.size(); // 0}
Synchronous cache interface with events