# primus/eventemitter3

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/primus-eventemitter3).**

3,514 stars · 234 forks · JavaScript · mit

## Links

- GitHub: https://github.com/primus/eventemitter3
- awesome-repositories: https://awesome-repositories.com/repository/primus-eventemitter3.md

## Topics

`browser` `eventemitter` `nodejs`

## Description

EventEmitter3 is a high-performance JavaScript event emitter and publish-subscribe library. It implements the observer pattern to enable decoupled communication between application components through the registration and emission of custom events.

The library functions as a context-aware event dispatcher, allowing specific execution contexts to be bound to listeners. This removes the need for manual function binding during event dispatching.

The project covers core event management capabilities, including listener registration and a synchronous execution loop for event delivery. It utilizes array-based listener storage to minimize memory overhead.

## Tags

### Programming Languages & Runtimes

- [Event Emitters](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/runtimes/asynchronous-execution-engines/event-emitters.md) — Provides a lightweight JavaScript utility for triggering named events and executing associated listener functions.
- [EventEmitter Implementations](https://awesome-repositories.com/f/programming-languages-runtimes/eventemitter-implementations.md) — Provides a high-performance implementation of the observer pattern compatible with Node.js EventEmitter expectations.
- [Function Context Binding](https://awesome-repositories.com/f/programming-languages-runtimes/function-context-binding.md) — Provides a mechanism to bind a specific object as the execution context for event listeners.

### Software Engineering & Architecture

- [Component Decoupling Patterns](https://awesome-repositories.com/f/software-engineering-architecture/component-decoupling-patterns.md) — Enables separate software modules to exchange data and trigger actions without requiring direct references.
- [Event Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/event-dispatchers.md) — Implements an architectural pattern for decoupling system components via a registry of event listeners.
- [Event Listeners](https://awesome-repositories.com/f/software-engineering-architecture/event-listeners.md) — Provides mechanisms for registering callback functions that react to specific emitted events. ([source](https://github.com/primus/eventemitter3/blob/master/rollup.config.mjs))
- [High-Performance Emitters](https://awesome-repositories.com/f/software-engineering-architecture/event-performance-utilities/high-performance-emitters.md) — Optimized for executing a large volume of event triggers with minimal memory overhead and fast processing speeds.
- [Observer Patterns](https://awesome-repositories.com/f/software-engineering-architecture/observer-patterns.md) — Implements the observer pattern to establish publish-subscribe relationships between decoupled components.
- [Context-Aware Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/reactive-messaging/reactive-event-driven-systems/event-dispatchers/context-aware-dispatchers.md) — Functions as a context-aware event dispatcher that binds specific execution contexts to listeners.
- [Memory-Efficient Listener Storage](https://awesome-repositories.com/f/software-engineering-architecture/memory-efficient-listener-storage.md) — Uses contiguous arrays to store event callbacks, minimizing memory overhead and optimizing iteration speed.
- [Synchronous Event Dispatch Loops](https://awesome-repositories.com/f/software-engineering-architecture/synchronous-event-dispatch-loops.md) — Executes registered listeners immediately and synchronously upon emission to ensure ordered event delivery.

### User Interface & Experience

- [Custom Event Emission](https://awesome-repositories.com/f/user-interface-experience/component-utilities/ui-frameworks/component-apis/event-communication-systems/event-emission-declarations/custom-event-emission.md) — Enables the triggering and notification of listeners for custom application events. ([source](https://github.com/primus/eventemitter3#readme))
- [Event Handling Systems](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interaction-and-event-handling/event-handling-architectures/event-handling-systems.md) — Provides a system for attaching listeners and triggering custom functions through a publish-subscribe pattern.
- [Lightweight Pub-Sub Managers](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interaction-and-event-handling/event-handling-architectures/event-handling-systems/cross-browser-event-managers/lightweight-pub-sub-managers.md) — Implements a minimalist pub-sub mechanism for coordinating communication between decoupled components.

### Part of an Awesome List

- [Event Handling](https://awesome-repositories.com/f/awesome-lists/devtools/event-handling.md) — High-performance event emitter.
