Newer
Older
CVSS_3.0_GUI / node_modules / nwjs-builder-phoenix / dist / lib / common / Event.js
root on 7 May 2019 606 bytes Initial commit
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Event = /** @class */ (function () {
    function Event(name) {
        this.listeners = [];
    }
    Event.prototype.subscribe = function (fn) {
        this.listeners.push(fn);
    };
    Event.prototype.trigger = function (args) {
        this.listeners.map(function (fn) { return fn(args); });
    };
    Event.prototype.unsubscribe = function (fn) {
        this.listeners = this.listeners.filter(function (f) { return f != fn; });
    };
    return Event;
}());
exports.Event = Event;
//# sourceMappingURL=Event.js.map