all files / src/ decorators.js

100% Statements 6/6
100% Branches 0/0
100% Functions 2/2
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18                       
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const async_event_dispatcher_1 = require("./async-event-dispatcher");
/**
 * Decorator is used to mark a method as an event listener
 *
 * @param {string} eventName
 * @param {number} priority
 * @returns {MethodDecorator}
 * @constructor
 */
function Observe(eventName, priority = 0) {
    return function (target, propertyKey) {
        async_event_dispatcher_1.asyncEventDispatcher.addListener(eventName, target[propertyKey].bind(target), priority);
    };
}
exports.Observe = Observe;
//# sourceMappingURL=decorators.js.map