1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1× 2× 3× 3× | import {asyncEventDispatcher} from './async-event-dispatcher'; /** * Decorator is used to mark a method as an event listener * * @param {string} eventName * @param {number} priority * @returns {MethodDecorator} * @constructor */ export function Observe<T>(eventName: string, priority = 0): MethodDecorator { return function (target: Object, propertyKey: string): void { asyncEventDispatcher.addListener(eventName, target[propertyKey].bind(target), priority); }; } |