UNPKG

@inventivetalent/loading-cache

Version:

loading cache based on ben-manes/caffeine and node-cache

28 lines 661 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CacheEvents = void 0; /** * Static definitions of all cache events */ class CacheEvents { static forward(source, emitter) { CacheEvents.ALL.forEach(e => { source.on(e, (...args) => emitter.emit(e, ...args)); }); } } exports.CacheEvents = CacheEvents; /** * (key, value) */ CacheEvents.EXPIRE = "expire"; /** * (stat, incAmount, prevAmount) */ CacheEvents.STAT = "stat"; /** * (error) */ CacheEvents.ERROR = "error"; CacheEvents.ALL = [CacheEvents.EXPIRE, CacheEvents.STAT, CacheEvents.ERROR]; //# sourceMappingURL=CacheEvents.js.map