node事件发射器
摘要:
demo:var events=require('events');var emitter=new events.EventEmitter();emitter.on('someEvent',function(arg1,arg2){ console.log('listener1',arg1,arg2);})emitter.on('someEvent',function(arg1,arg2){ console.log('listener2',arg1,arg2);})emitter.emit('someEven 阅读全文
posted @ 2013-06-02 10:17 Ijavascript 阅读(159) 评论(0) 推荐(0) 编辑