tsx-event
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

tsx-event

事件处理封装库,提供通用的API方法。

Installing

Using npm:

$ npm install tsx-event

Example

import Events from 'tsx-event';

function testHandler(event: any){
    console.log('bala bala bala!');
}

Events.addEvent(document, 'click', testHandler);
Events.removeEvent(document, 'click', testHandler);

API

Events.addEvent(element: any, type: string, handler: Function, userCapture: boolean = false): void
Events.removeEvent(element: any, type: string, handler: Function, userCapture: boolean = false): void

Package Sidebar

Install

npm i tsx-event

Weekly Downloads

7

Version

1.0.0

License

ISC

Unpacked Size

14.3 kB

Total Files

13

Last publish

Collaborators

  • caojianping