1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/packages/unleash-api/lib/eventStore.js
2020-02-20 08:30:26 +01:00

18 lines
416 B
JavaScript

var util = require('util');
var EventEmitter = require('events').EventEmitter;
function EventStore(eventDb) {
this.eventDb = eventDb;
EventEmitter.call(this);
}
util.inherits(EventStore, EventEmitter);
EventStore.prototype.create = function (event) {
var that = this;
return this.eventDb.store(event).then(function() {
that.emit(event.type, event);
});
};
module.exports = EventStore;