事件处理封装库,提供通用的API方法。
Using npm:
$ npm install tsx-event
import Events from 'tsx-event';
function testHandler(event: any){
console.log('bala bala bala!');
}
Events.addEvent(document, 'click', testHandler);
Events.removeEvent(document, 'click', testHandler);