Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 626 Bytes

README.md

File metadata and controls

26 lines (22 loc) · 626 Bytes

EventEmitter

EventEmitter for deno, API is the same as Nodejs, Have all the APIs of nodejs

Refer to nodejs events documentation

Useage

import EventEmitter from "https://deno.land/x/[email protected]/mod.ts";

const ee = new EventEmitter();
ee.on("message", msg => {
  console.log(msg);
});
emitter.emit("message");

extends

import EventEmitter from "https://deno.land/x/[email protected]/mod.ts";

class A extends EventEmitter {}
const a = new A();
a.on("message", msg => {
  console.log(msg);
});
a.emit("message");