import type { AnyToVoidFnSignature } from '../misc/functions' ; author Yuliya Adamskaya
  export abstract class Observable < Callback extends AnyToVoidFnSignature = AnyToVoidFnSignature > { protected _listeners = new Set < Callback > ( ) ; public addListener ( listener ) { this . _listeners . add ( listener ) ; } public removeListener ( listener ) { this . _listeners . delete ( listener ) ; } protected fire ( ... args ) { this . _listeners . forEach ( ( listener ) => { try { listener . apply ( this , args ) ; } catch ( e ) { console . error ( e ) ; } } ) ; } }