UNPKG

thebe-core

Version:

Typescript based core functionality for Thebe

34 lines 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EventEmitter = void 0; const events_1 = require("./events"); 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(events_1.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(events_1.ThebeEventType.error, { subject: this._subject, id: this._id, object: this._object, status, message, }); } } exports.EventEmitter = EventEmitter; //# sourceMappingURL=emitter.js.map