UNPKG

@observertc/client-monitor-js

Version:

ObserveRTC Client Integration Javascript Library

1 lines 443 B
import{createLogger as t}from"../utils/logger";const e=t("Detectors");export class Detectors{_detectors;constructor(...t){this._detectors=t}add(t){this._detectors.push(t)}remove(t){this._detectors=this._detectors.filter((e=>e!==t))}get listOfNames(){return this._detectors.map((t=>t.name))}update(){for(const t of this._detectors)try{t.update()}catch(r){e.warn(`Error updating detector ${t?.constructor?.name}`,r)}}clear(){this._detectors=[]}}