@jsango/events
v1.3.0
Published
Typed event bus, handlers, middleware, and queue integration for jsango
Readme
@jsango/events
Typed event definitions, tri-mode execution (sync, async, queued), priority handlers, and event middleware.
Part of the jsango backend framework for TypeScript.
Installation
pnpm add @jsango/eventsUsage
import { EventBus, defineEvent } from '@jsango/events';
const UserRegistered = defineEvent<{ userId: string }>('user.registered');
const bus = new EventBus();
bus.on(UserRegistered, async (event) => {
console.log('Registered user:', event.payload.userId);
});
await bus.dispatch(UserRegistered.create({ userId: 'user-123' }));Documentation
For full architecture documentation and guides, visit the jsango documentation.
License
MIT © jsango contributors
