jts-events
v1.0.1
Published
JavaScript Events的TypeScript封装,提供事件的添加、移除等操作。
Downloads
8
Maintainers
Readme
jts-events
JavaScript Events的TypeScript封装,提供事件的添加、移除等操作。
安装
Using npm:
$ npm install jts-events
Using yarn:
$ yarn add jts-events
示例
import Events from 'jts-events';
// test for events
function testHandler(event: any){
console.log('bala bala bala!');
}
Events.addEvent(document, 'click', testHandler);
Events.removeEvent(document, 'click', testHandler);