@melchyore/adonis-cache
Version:
Cache package for AdonisJS V5
16 lines (15 loc) • 407 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class CacheEvent {
constructor(config, emitter) {
this.config = config;
this.emitter = emitter;
}
emit(data) {
const event = data.EVENT;
if (this.config.events[event]) {
this.emitter.emit(event, data.toJSON());
}
}
}
exports.default = CacheEvent;