1.0.5 • Published 4 years ago
errorsparty.dev-events v1.0.5
errorsparty.dev-events
A typed, small event emitter.
How to use?
This is as easy as it can be.
Firstly, install the package.
yarn add errorsparty.dev-events
Second, import it into your project wherever you need it.
import { EventEmitter } from "errorsparty.dev-events";
Third, use it to your needs.
There are some examples on how you can use it:
- default - A simple example.
- once - A simple example, but shows how to only listen to an event once.
- multiple - An example with multiple event emitters.
- extend - A little bit more advanced example with a class that extends the event emitter.
- alice-bob - An advanced example with Alice and Bob chatting with each other, using the event emitter to communicate.