@ecfjs/events
v1.0.0-rc.2
Published
ECF event bus with typed event classes, listeners, wildcards, and deferred dispatch
Maintainers
Readme
@ecfjs/events — Priority Lifecycle Event Bus
@ecfjs/events is the priority-aware event dispatcher for the ECF (Elegant Core Framework) ecosystem.
Features
- EventDispatcher — synchronous and async event dispatch
- ListenerRegistry — priority-ordered listener registration
- EventSubscriber — class-based event subscription
- EventAutoDiscoverer — automatic listener discovery
- ShouldQueue / ShouldBroadcast — queue and broadcast integration contracts
Quick Start
import { Application } from "@ecfjs/core";
import { EventServiceProvider, Event } from "@ecfjs/events";
const app = new Application();
app.register(EventServiceProvider);
app.boot();
Event.on("user.registered", (payload) => {
console.log("New user:", payload.email);
});
Event.dispatch("user.registered", { email: "[email protected]" });Documentation
- ARCHITECTURE.md — package architecture
License
MIT
