UNPKG

rx-player

Version:
33 lines (32 loc) 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var CoreInterface = /** @class */ (function () { function CoreInterface() { this.listeners = []; this.listenersError = []; } CoreInterface.prototype.addMessageListener = function (cb) { this.listeners.push(cb); }; CoreInterface.prototype.removeMessageListener = function (cb) { var index = this.listeners.indexOf(cb); if (index >= 0) { this.listeners.splice(index, 1); } }; CoreInterface.prototype.addErrorListener = function (cb) { this.listenersError.push(cb); }; CoreInterface.prototype.removeErrorListener = function (cb) { var index = this.listenersError.indexOf(cb); if (index >= 0) { this.listenersError.splice(index, 1); } }; CoreInterface.prototype.dispose = function () { this.listeners.length = 0; this.listenersError.length = 0; }; return CoreInterface; }()); exports.default = CoreInterface;