sinch-rtc
Version:
RTC JavaScript/Web SDK
27 lines • 700 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Event = void 0;
class Event {
constructor(subscriber) {
this.subscribers = new Array();
this.fire = (arg) => {
this.subscribers.forEach((s) => s(arg));
};
if (subscriber)
this.add(subscriber);
}
add(subscription) {
this.subscribers.push(subscription);
}
remove(subscription) {
const pos = this.subscribers.indexOf(subscription);
if (pos >= 0) {
this.subscribers.splice(pos, 1);
}
}
clean() {
this.subscribers = [];
}
}
exports.Event = Event;
//# sourceMappingURL=Event.js.map