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
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var Event = /** @class */ (function () {
  4. function Event(name) {
  5. this.listeners = [];
  6. }
  7. Event.prototype.subscribe = function (fn) {
  8. this.listeners.push(fn);
  9. };
  10. Event.prototype.trigger = function (args) {
  11. this.listeners.map(function (fn) { return fn(args); });
  12. };
  13. Event.prototype.unsubscribe = function (fn) {
  14. this.listeners = this.listeners.filter(function (f) { return f != fn; });
  15. };
  16. return Event;
  17. }());
  18. exports.Event = Event;
  19. //# sourceMappingURL=Event.js.map
Buy Me A Coffee