Asynchronous 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: IAsyncCacheWithEvents<string>) { const value = await cache.get('key'); await cache.set('key', 'value'); await cache.has('key'); // true await cache.delete('key'); await cache.clear(); await cache.size(); // 0} Copy
function foo(cache: IAsyncCacheWithEvents<string>) { const value = await cache.get('key'); await cache.set('key', 'value'); await cache.has('key'); // true await cache.delete('key'); await cache.clear(); await cache.size(); // 0}
Asynchronous cache interface with events