Overview of Emittery features
mainEmittery is an async-first event emitter designed for high performance and modern JavaScript environments. Key features include:
- Async-first: Listeners are deferred to the next microtask to prevent blocking the main thread.
- TypeScript support: Provides strongly typed events.
- Async iteration: Supports
for await...offor consuming events. - Lifecycle hooks: Supports
initanddeinitfor lazy resource management. - Cancellation: Built-in
AbortSignalsupport. - Automatic cleanup: Supports
Symbol.disposeandSymbol.asyncDispose. - Meta events: Allows observing changes to listeners.
- Debug mode: Includes customizable logging.
- Zero dependencies: Lightweight and secure.