 'use strict';
const  EventEmitter = require('events');
class MyEvent extends EventEmitter{
  	constructor(){
        super();
    } 
    //重写events的on事件
    on(eventName, listener){ 
       super.removeAllListeners(eventName); 
       super.on(eventName, listener);
    }

    emit(eventName, ...args){
        super.emit(eventName, ...args);
        console.log(eventName)
    }
}

module.exports = new MyEvent() ;