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

16 lines
325 B
JavaScript
Raw Normal View History

2016-06-18 21:53:18 +02:00
'use strict';
2016-10-26 10:43:11 +02:00
2016-06-18 21:53:18 +02:00
const EventEmitter = require('events').EventEmitter;
2016-11-01 15:38:27 +01:00
module.exports = class EventStore extends EventEmitter {
constructor (eventDb) {
super();
this.eventDb = eventDb;
}
2016-11-01 15:38:27 +01:00
create (event) {
return this.eventDb.store(event).then(() => this.emit(event.type, event));
}
};