Const bluebirdDecorator
bluebirdDecorator: function = DecoratorUtils.createDecorator([DecoratorUtils.declarationTypes.CLASS_METHOD,DecoratorUtils.declarationTypes.CLASS_ACCESSOR,DecoratorUtils.declarationTypes.OBJECT_LITERAL_METHOD,DecoratorUtils.declarationTypes.OBJECT_LITERAL_ACCESSOR], <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<(...args) => Bluebird<T>>) =>{let method = descriptor.value;descriptor.value = function (...args): Bluebird<T>{let self = this;//return returnValue instanceof Promise ? Bluebird.resolve(returnValue) : returnValue;return Bluebird.resolve().then(function (){return method.apply(self, args);});};return descriptor;}) as MethodDecorator
Type declaration
-
- <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void
-
Type parameters
Parameters
-
target: Object
-
propertyKey: string | symbol
-
descriptor: TypedPropertyDescriptor<T>
Returns TypedPropertyDescriptor<T>
|
void