gs-events

1.0.11 • Public • Published

Build Status

安装

npm i gs-events --save-dev

文档

基本用法

import { Event, EventDispatcher } from "gs-events";
 
class Node extends EventDispatcher {
    constructor() {
        super();
        this.addEventListener("custom", this.handler);
    }
    
    handler( evt ) {
        console.log("scope:", this);
        console.log("event:", evt);
    }
}
 
let node = new Node();
node.dispatchEvent(new Event("custom", false, true));

Package Sidebar

Install

npm i gs-events

Weekly Downloads

14

Version

1.0.11

License

MIT

Unpacked Size

3.4 MB

Total Files

80

Last publish

Collaborators

  • samlv9