import Subject from '../../tools/subject' ; import { IMapItem } from '../stream.main/file.map' ; interface ISubjects { onStreamBytesMapUpdated : Subject < IMapItem > ; } export class EventsHub { private _subjects : ISubjects ; private _streamId : string ; constructor ( streamId ) { this . _streamId = streamId ; this . _subjects = { onStreamBytesMapUpdated : new Subject ( `onStreamBytesMapUpdated: ${ streamId }` ) , } ; } public destroy ( ) { Object . keys ( this . _subjects ) . forEach ( ( key ) => { ( this . _subjects as any ) [ key ] . destroy ( ) ; } ) ; } public getSubject ( ) { return this . _subjects ; } }