嗨嗨大家好,我是菜鳥前端工程師,敬請大家鞭小力點
var events = require('events'); var eventEmitter = new events.EventEmitter(); var myhandler = function() { console.log('event trigger'); } eventEmitter.on('trigger',myhandler); eventEmitter.emit('trigger');
沒有留言:
張貼留言