@luolapeikko/cache-types
    Preparing search index...

    Type Alias ICacheWithEvents<Payload, Key>

    ICacheWithEvents: ICache<Payload, Key> & EventEmitter<
        CacheEventsMap<Payload, Key>,
    >

    Synchronous cache interface with events

    Type Parameters

    • Payload

      The type of the cached value

    • Key = string

      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
    }