UNPKG

mediatr-ts

Version:

Mimic the famous MediatR csharp library see: (https://github.com/jbogard/MediatR)

18 lines (17 loc) 478 B
/** * The notification handler class * * @exports * @interface NotificationHandler */ export default interface NotificationHandler<T> { /** * The notification handler called on T event * * @param {T} notification The notification param * @returns {Promise<void>} * @memberof INotificationHandler */ handle(notification: T): Promise<void>; } export type NotificationHandlerClass<T> = new (...args: unknown[]) => NotificationHandler<T>;