A small library for asynchronous event emitters.
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.
See license in LICENSE