Function: createMethodDecorator()
createMethodDecorator(
fn
:MethodDecorator
):MethodDecorator
Utility to make a method decorator with lighter syntax and inferred types.
// Enumerable function
function enumerableMethod(value: boolean) {
return createMethodDecorator((_target, _propertyKey, descriptor) => {
descriptor.enumerable = value;
});
}
Parameters
Parameter | Type | Description |
---|---|---|
fn | MethodDecorator | The method to decorate |
Returns
MethodDecorator