1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00
unleash.unleash/packages/unleash-api/lib/event-store.js
2020-02-20 08:30:34 +01:00

16 lines
325 B
JavaScript

'use strict';
const EventEmitter = require('events').EventEmitter;
module.exports = class EventStore extends EventEmitter {
constructor (eventDb) {
super();
this.eventDb = eventDb;
}
create (event) {
return this.eventDb.store(event).then(() => this.emit(event.type, event));
}
};