| 1 2 3 4 5 6 7 8 9 10 11 12 | 1x 1x 1x 1x | /**
* Binds parameters decorators to the particular method
* Useful when the language doesn't provide a 'Parameter Decorators' feature (vanilla JavaScript)
* @param {} ...decorators
*/
export function Bind(...decorators: any[]) {
return (target: object, key, descriptor) => {
decorators.forEach((fn, index) => fn(target, key, index));
return descriptor;
};
}
|