import EventEmitter from 'eventemitter3' ; export enum Action { SPEED_NOTIFY = 'speed-notify' } class Event { protected EE = new EventEmitter ( ) ; notifySpeedTest ( ) { this . EE . emit ( Action . SPEED_NOTIFY ) ; } subscribe < T > ( event , callback ) { this . EE . addListener ( event , callback ) ; } unsubscribe < T > ( event , callback ) { this . EE . removeListener ( event , callback ) ; } } export default new Event ( ) ;