@ainc/events
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

@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);

Readme

Keywords

none

Package Sidebar

Install

npm i @ainc/events

Weekly Downloads

7

Version

0.1.1

License

MIT

Unpacked Size

8.59 kB

Total Files

8

Last publish

Collaborators

  • absock
  • edonet