Files
zerobyte/app/server/core/events.ts
2026-04-22 22:04:46 +02:00

10 lines
392 B
TypeScript

import { EventEmitter } from "node:events";
import type { TypedEmitter } from "tiny-typed-emitter";
import type { ServerEventHandlers } from "~/schemas/server-events";
/**
* Global event emitter for server-side events
* Use this to emit events that should be broadcasted to connected clients via SSE
*/
export const serverEvents = new EventEmitter() as TypedEmitter<ServerEventHandlers>;