Server IP : 150.95.80.236 / Your IP : 3.142.54.153 Web Server : Apache System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : social-telecare ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/pcu.in.th/api-uat.pcu.in.th/node_modules/rxjs/dist/esm5/internal/observable/ |
Upload File : |
import { __read } from "tslib"; import { innerFrom } from '../observable/innerFrom'; import { Observable } from '../Observable'; import { mergeMap } from '../operators/mergeMap'; import { isArrayLike } from '../util/isArrayLike'; import { isFunction } from '../util/isFunction'; import { mapOneOrManyArgs } from '../util/mapOneOrManyArgs'; var nodeEventEmitterMethods = ['addListener', 'removeListener']; var eventTargetMethods = ['addEventListener', 'removeEventListener']; var jqueryMethods = ['on', 'off']; export function fromEvent(target, eventName, options, resultSelector) { if (isFunction(options)) { resultSelector = options; options = undefined; } if (resultSelector) { return fromEvent(target, eventName, options).pipe(mapOneOrManyArgs(resultSelector)); } var _a = __read(isEventTarget(target) ? eventTargetMethods.map(function (methodName) { return function (handler) { return target[methodName](eventName, handler, options); }; }) : isNodeStyleEventEmitter(target) ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName)) : isJQueryStyleEventEmitter(target) ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName)) : [], 2), add = _a[0], remove = _a[1]; if (!add) { if (isArrayLike(target)) { return mergeMap(function (subTarget) { return fromEvent(subTarget, eventName, options); })(innerFrom(target)); } } if (!add) { throw new TypeError('Invalid event target'); } return new Observable(function (subscriber) { var handler = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return subscriber.next(1 < args.length ? args : args[0]); }; add(handler); return function () { return remove(handler); }; }); } function toCommonHandlerRegistry(target, eventName) { return function (methodName) { return function (handler) { return target[methodName](eventName, handler); }; }; } function isNodeStyleEventEmitter(target) { return isFunction(target.addListener) && isFunction(target.removeListener); } function isJQueryStyleEventEmitter(target) { return isFunction(target.on) && isFunction(target.off); } function isEventTarget(target) { return isFunction(target.addEventListener) && isFunction(target.removeEventListener); } //# sourceMappingURL=fromEvent.js.map