UNPKG

@cashfarm/plow

Version:

Library for validating input data and parameters

26 lines 826 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const symbols_1 = require("../symbols"); const config_1 = require("../config"); /** * IDomain event symbol * * Should be used for binding domain events to inversion of control containers */ exports.IDomainEvent = Symbol('IDomainEvent'); /** * Registers the class as a Domain Event * @param name The name of the event */ function DomainEvent(fqn, eventName) { if (fqn.indexOf(':') < 0) { fqn += `${config_1.PlowConfig.appPackageName}:`; } return (target) => { Reflect.defineMetadata(symbols_1.Symbols.EventFQN, fqn, target); if (eventName) Reflect.defineMetadata(symbols_1.Symbols.EventName, eventName, target); }; } exports.DomainEvent = DomainEvent; //# sourceMappingURL=domainEvent.js.map