eemitt


A lightweight, TypeScript-native event emitter library supporting modular event listeners, one-time triggers, propagation control, and more.
Features
- TypeScript Support: Full type definitions and generic support
- High Performance: Minimal memory and execution overhead
- Propagation Control:
stopImmediatePropagation() halts further listener execution
- Flexible Binding: Supports batch event operations
- Mixin Mode: Inject event capabilities into any object using
mixin
- Custom Event Data: Pass complex data via
EventType objects
Documentation
For detailed usage instructions and API references, please visit the official documentation:
👉 View Full Documentation
Quick Start
Basic Usage
import { Emitter } from 'eemitt';
const emitter = new Emitter();
emitter.on('message', (evt) => {
console.log('Received message:', evt.payload);
});
emitter.emit({ type: 'message', payload: 'Hello World' });
Contributing
We welcome contributions from the community! If you find a bug or want to suggest an improvement, feel free to open an issue or submit a pull request.
How to Contribute
- Fork the repository.
- Create a new branch for your changes.
- Submit a pull request with a clear description of your changes.
License
This project is licensed under the MIT License.
Browser Support
| Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ |