crystal-event-emitter
A small, modern event emitter base class with no dependencies
Last updated 3 years ago by kdex .
GPL-3.0 · Original npm · Tarball · package.json
$ cnpm install crystal-event-emitter 
SYNC missed versions from official npm registry.

crystal-event-emitter

travis codecov dependencies documentation

A small, modern base class for event emitters — no dependencies.

Documentation

You can find a documentation here.

Examples

Inferred listeners

import EventEmitter from "crystal-event-emitter";
class Cat extends EventEmitter {
	constructor() {
		super({
			inferListeners: true
		});
	}
	onFeed() {
		console.log("More food, please!");
	}
}
const cat = new Cat();
cat.emit("feed"); // "More food, please!"

Manual listeners

import EventEmitter from "crystal-event-emitter";
class Cat extends EventEmitter {
	constructor() {
		super();
	}
	onFeed() {
		console.log("More food, please!");
	}
}
const cat = new Cat();
cat.on("feed", cat.onFeed);
cat.emit("feed"); // "More food, please!"

Current Tags

  • 2.1.5                                ...           latest (3 years ago)

19 Versions

  • 2.1.5                                ...           3 years ago
  • 2.1.4                                ...           3 years ago
  • 2.1.3                                ...           3 years ago
  • 2.1.2                                ...           3 years ago
  • 2.1.1                                ...           4 years ago
  • 2.0.2                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.3.1                                ...           4 years ago
  • 1.3.0                                ...           4 years ago
  • 1.2.1                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.3                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (14)

Copyright 2014 - 2016 © taobao.org |