thebe-core
Version:
Typescript based core functionality for Thebe
30 lines • 913 B
JavaScript
import { ThebeEventType } from './events';
export class EventEmitter {
constructor(id, config, subject, object) {
this._id = id;
this._config = config;
this._subject = subject;
this._object = object;
}
triggerStatus({ status, message }) {
console.debug(`${status} ${message}`);
this._config.events.trigger(ThebeEventType.status, {
subject: this._subject,
id: this._id,
object: this._object,
status,
message,
});
}
triggerError({ status, message }) {
console.debug(`Error [${this._subject}][${this._id}] ${message}`);
this._config.events.trigger(ThebeEventType.error, {
subject: this._subject,
id: this._id,
object: this._object,
status,
message,
});
}
}
//# sourceMappingURL=emitter.js.map