@ainc/events
A simple event emitter!
Install
$ yarn add @ainc/events
Usage
import { EventEmitter } from '@ainc/events';
const events = new EventEmitter<{ foo(value: number): void }>();
const cb = (value: number) => console.log(value);
events.on('foo', cb);
events.once('foo', cb);
events.off('foo', cb);
events.emit('foo', 1);