https://github.com/icholy/eventemitter
https://github.com/icholy/eventemitter
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/icholy/eventemitter
- Owner: icholy
- Created: 2016-01-12T21:47:52.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-12-15T17:45:26.000Z (over 9 years ago)
- Last Synced: 2025-01-30T03:13:23.070Z (over 1 year ago)
- Language: TypeScript
- Size: 35.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EventEmitter:
> Partially Type Safe Event Emitter
**Usage:**
``` ts
enum Events { A, B, C }
class Foo extends EventEmitter {}
var foo = new Foo();
foo.addListener(Events.A, (payload: string) => {
console.log(payload);
});
foo.emitEvent(Events.A, "Hello World!");
```