Simple sync/async emitter
This differs from the built-in events
emitter because:
- quick and simple - only one data item passed with message
- no special-case logic for
error
- can have async emits, allowing the emitter to
await
the processing
It's only for me. Don't use it.
Subclass from this, or create a new one
Adds a handler for the event type. Returns a function to remove.
Removes the handler for this event type.
Returns a promise which resolves the first time this event is called
Emits the event to all handlers, which are run synchronously.
Emits the event to all handlers, resolving when they have all completed.
That's it. It's simple. Don't use it.