UNPKG

react-application-core

Version:

A react-based application core for the business applications.

64 lines 2.52 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.EventManager = void 0; var crossvent = require("crossvent"); var inversify_1 = require("inversify"); var EventManager = /** @class */ (function () { function EventManager() { } /** * @stable [23.02.2019] * @param {EventTarget} el * @param {string} type * @param {(...args) => AnyT} callback * @param {boolean} capturing * @returns {() => void} */ EventManager.prototype.subscribe = function (el, type, callback, capturing) { var _this = this; this.add(el, type, callback, capturing); return function () { return _this.remove(el, type, callback, capturing); }; }; /** * @stable [23.02.2019] * @param {EventTarget} el * @param {string} type * @param {(...args) => void} callback * @param {boolean} capturing */ EventManager.prototype.add = function (el, type, callback, capturing) { crossvent.add(el, type, callback, capturing); }; /** * @stable [23.02.2019] * @param {EventTarget} el * @param {string} type * @param {(...args) => void} callback * @param {boolean} capturing */ EventManager.prototype.remove = function (el, type, callback, capturing) { crossvent.remove(el, type, callback, capturing); }; /** * @stable [23.02.2019] * @param {EventTarget} el * @param {string} type * @param {(...args) => void} callback * @param {AnyT} model */ EventManager.prototype.fabricate = function (el, type, callback, model) { crossvent.fabricate(el, type, callback, model); }; EventManager = __decorate([ inversify_1.injectable() ], EventManager); return EventManager; }()); exports.EventManager = EventManager; //# sourceMappingURL=event-manager.service.js.map