3 Matching Annotations
  1. Feb 2025
    1. Essentially, decorators can be used to metaprogram and add functionality to a value, without fundamentally changing its external behavior.
    1. function loggable(target: any, propertyKey: string, descriptor: PropertyDescriptor) { let originalMethod = descriptor.value; descriptor.value = function(...args: any[]) { console.log(`Calling ${propertyKey}`); return originalMethod.apply(this, args); }; }
  2. Nov 2020