UNPKG

@ea-utilities/mediator

Version:

Utility for the Mediator Pattern Mediator is a versatile class designed to streamline event-driven, asynchronous programming. It enables you to easily register, unregister, and invoke subscriber methods, making it ideal for managing WebSockets, Ajax call

6 lines (5 loc) 244 B
import { IRequest } from './IRequest'; export declare abstract class IRequestHandler<TCommand extends IRequest, IResponse = void> { initialize?(event: TCommand): void; abstract handle(event: TCommand): IResponse | Promise<IResponse>; }