mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
16 lines
325 B
JavaScript
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));
|
|
}
|
|
};
|
|
|