@trenskow/async-event-emitter

0.1.21 • Public • Published

async-event-emitter

A small library for asynchronous event emitters.

Usage

Below is an example on how to use.

import EventEmitter from '@trenskow/async-event-emitter';

const emitter = new EventEmitter();

emmiter.on('greeting', async (text) => {
	console.info(text);
});

await emitter.emit('greeting', 'Hello, World!');

In the above example Hello, World! will be output to the console.

License

See license in LICENSE

Package Sidebar

Install

npm i @trenskow/async-event-emitter

Weekly Downloads

1

Version

0.1.21

License

BSD-2-Clause

Unpacked Size

4.16 kB

Total Files

5

Last publish

Collaborators

  • trenskow