UNPKG

mediatr-ts

Version:

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

19 lines 612 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var index_js_1 = require("../models/mappings/index.js"); /** * Decorate the requestHandler with this attribute * * @param value The request type */ var requestHandler = function (value) { return function (target) { index_js_1.typeMappings.requestHandlers.throwIfExistingTypeMappings(value); index_js_1.typeMappings.requestHandlers.add({ requestClass: value, handlerClass: target }); }; }; exports.default = requestHandler; //# sourceMappingURL=requestHandler.attribute.js.map