Skip to main content
Module

x/mandarinets/mod.ts>parameterDecoratorFactory

Mandarine.TS is a typescript, decorator-driven framework that allows you to create server-side applications. Mandarine.TS provides a range of built-in solutions such as Dependency Injection, Components, ORM and more. Under its umbrella, Mandarine.TS has 4 modules: Core, Data, Security and MVC, these modules will offer you the requirements to build a Mandarine-powered application.
Latest
function parameterDecoratorFactory
import { parameterDecoratorFactory } from "https://deno.land/x/mandarinets@v2.3.2/mod.ts";

This function creates a custom parameter decorator (used in a HTTP Handler). With this function, you can establish your own behaviors towards an injection which will be made when processing the handler This function can be generic in order to specify what type of data your parameter will receive, for this it takes two generic arguments (DecoratorData, DecoratorReturn)

Examples

Example 1

 const UserId = parameterDecoratorFactory<number, number>((context: Mandarine.Types.RequestContextAcessor, data) => context.getRequest().userID);

Type Parameters

optional
DecoratorData = any
optional
DecoratorReturn = any

Parameters

executor: Mandarine.MandarineMVC.CustomDecoratorExecutor<DecoratorData, DecoratorReturn>