webdetector/.cache/cf/a3301968ea7e13219fc8b7a812c73c.json
2018-12-21 13:36:28 +01:00

1 line
33 KiB
JSON

{"id":"../node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js.map","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/src/internal/observable/fromEventPattern.ts","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/package.json","includedInParent":true,"mtime":1545395695572},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/package.json","includedInParent":true,"mtime":1545395355370},{"name":"../Observable","loc":{"line":2,"column":27},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/Observable.js"},{"name":"../util/isArray","loc":{"line":3,"column":24},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/util/isArray.js"},{"name":"../util/isFunction","loc":{"line":4,"column":27},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/util/isFunction.js"},{"name":"../operators/map","loc":{"line":5,"column":20},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/map.js"}],"generated":{"js":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.fromEventPattern = fromEventPattern;\n\nvar _Observable = require(\"../Observable\");\n\nvar _isArray = require(\"../util/isArray\");\n\nvar _isFunction = require(\"../util/isFunction\");\n\nvar _map = require(\"../operators/map\");\n\n/** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */\nfunction fromEventPattern(addHandler, removeHandler, resultSelector) {\n if (resultSelector) {\n return fromEventPattern(addHandler, removeHandler).pipe((0, _map.map)(function (args) {\n return (0, _isArray.isArray)(args) ? resultSelector.apply(void 0, args) : resultSelector(args);\n }));\n }\n\n return new _Observable.Observable(function (subscriber) {\n var handler = function () {\n var e = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n e[_i] = arguments[_i];\n }\n\n return subscriber.next(e.length === 1 ? e[0] : e);\n };\n\n var retValue;\n\n try {\n retValue = addHandler(handler);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n\n if (!(0, _isFunction.isFunction)(removeHandler)) {\n return undefined;\n }\n\n return function () {\n return removeHandler(handler, retValue);\n };\n });\n}","map":{"mappings":[{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":2,"column":0},"generated":{"line":8,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":3,"column":0},"generated":{"line":10,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":5,"column":0},"generated":{"line":12,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":135,"column":0},"generated":{"line":14,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":1,"column":0},"generated":{"line":16,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":139,"column":2},"generated":{"line":17,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":139,"column":6},"generated":{"line":17,"column":9}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":139,"column":2},"generated":{"line":17,"column":25}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":139,"column":22},"generated":{"line":17,"column":26}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":139,"column":2},"generated":{"line":17,"column":36}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":139,"column":22},"generated":{"line":17,"column":38}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":139,"column":2},"generated":{"line":17,"column":51}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":139,"column":22},"generated":{"line":17,"column":53}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":139,"column":2},"generated":{"line":17,"column":67}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":139,"column":22},"generated":{"line":17,"column":69}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":141,"column":4},"generated":{"line":18,"column":6}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":141,"column":11},"generated":{"line":18,"column":22}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":11}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":27}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":28}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":38}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":40}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":53}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":54}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":55}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":59}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":60}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":74}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":84}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":88}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":19,"column":90}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":13}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":35}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":39}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":43}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":57}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":58}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":63}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":64}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":69}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":70}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":72}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":76}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":77}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":80}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":94}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":95}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":99}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":20,"column":100}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":21,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":21,"column":5}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":21,"column":6}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":144,"column":3},"generated":{"line":21,"column":7}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":146,"column":2},"generated":{"line":22,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":4},"generated":{"line":24,"column":9}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":10},"generated":{"line":24,"column":13}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":4},"generated":{"line":24,"column":35}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":20},"generated":{"line":24,"column":36}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":20},"generated":{"line":24,"column":46}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":20},"generated":{"line":24,"column":56}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":20},"generated":{"line":24,"column":58}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":21},"generated":{"line":25,"column":8}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":21},"generated":{"line":25,"column":15}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":21},"generated":{"line":25,"column":18}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":30},"generated":{"line":25,"column":30}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":21},"generated":{"line":26,"column":11}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":21},"generated":{"line":26,"column":14}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":21},"generated":{"line":28,"column":11}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":21},"generated":{"line":28,"column":15}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":21},"generated":{"line":28,"column":17}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":21},"generated":{"line":28,"column":20}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":21},"generated":{"line":28,"column":23}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":21},"generated":{"line":28,"column":25}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":21},"generated":{"line":28,"column":28}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":30},"generated":{"line":28,"column":37}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":30},"generated":{"line":28,"column":38}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":30},"generated":{"line":28,"column":46}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":30},"generated":{"line":28,"column":48}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":30},"generated":{"line":28,"column":52}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":35},"generated":{"line":30,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":13}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":23}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":24}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":28}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":29}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":30}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":31}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":37}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":42}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":43}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":46}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":47}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":48}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":49}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":50}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":53}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":54}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":78},"generated":{"line":32,"column":55}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":149,"column":4},"generated":{"line":33,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":150,"column":4},"generated":{"line":35,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":150,"column":8},"generated":{"line":35,"column":8}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":150,"column":4},"generated":{"line":35,"column":16}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":151,"column":6},"generated":{"line":37,"column":8}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":152,"column":5},"generated":{"line":38,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":152,"column":5},"generated":{"line":38,"column":6}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":152,"column":5},"generated":{"line":38,"column":14}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":152,"column":5},"generated":{"line":38,"column":17}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":152,"column":5},"generated":{"line":38,"column":27}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":152,"column":5},"generated":{"line":38,"column":28}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":152,"column":5},"generated":{"line":38,"column":35}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":152,"column":5},"generated":{"line":38,"column":36}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":152,"column":6},"generated":{"line":39,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":153,"column":6},"generated":{"line":39,"column":13}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":153,"column":6},"generated":{"line":39,"column":18}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":154,"column":6},"generated":{"line":40,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":154,"column":6},"generated":{"line":40,"column":6}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":154,"column":13},"generated":{"line":40,"column":16}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":154,"column":13},"generated":{"line":40,"column":17}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":154,"column":6},"generated":{"line":40,"column":22}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":154,"column":23},"generated":{"line":40,"column":23}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":154,"column":6},"generated":{"line":40,"column":26}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":155,"column":5},"generated":{"line":41,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":155,"column":5},"generated":{"line":41,"column":13}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":155,"column":5},"generated":{"line":41,"column":22}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":157,"column":4},"generated":{"line":42,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":158,"column":6},"generated":{"line":44,"column":8}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":158,"column":6},"generated":{"line":44,"column":9}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":158,"column":13},"generated":{"line":44,"column":37}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":158,"column":6},"generated":{"line":44,"column":50}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":158,"column":23},"generated":{"line":44,"column":53}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":159,"column":5},"generated":{"line":45,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":159,"column":5},"generated":{"line":45,"column":13}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":159,"column":5},"generated":{"line":45,"column":22}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":161,"column":4},"generated":{"line":46,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":162,"column":5},"generated":{"line":48,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":162,"column":5},"generated":{"line":48,"column":11}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":162,"column":5},"generated":{"line":48,"column":23}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":162,"column":5},"generated":{"line":49,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":162,"column":5},"generated":{"line":49,"column":13}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":162,"column":5},"generated":{"line":49,"column":26}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":162,"column":5},"generated":{"line":49,"column":27}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":162,"column":5},"generated":{"line":49,"column":34}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":162,"column":5},"generated":{"line":49,"column":36}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":162,"column":5},"generated":{"line":49,"column":44}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":162,"column":5},"generated":{"line":49,"column":45}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":162,"column":5},"generated":{"line":50,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":162,"column":5},"generated":{"line":50,"column":5}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":163,"column":1},"generated":{"line":51,"column":0}},{"source":"../../../src/internal/observable/fromEventPattern.ts","name":null,"original":{"line":147,"column":4},"generated":{"line":51,"column":3}}],"sources":{"../../../src/internal/observable/fromEventPattern.ts":"import { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { isFunction } from '../util/isFunction';\nimport { fromEvent } from './fromEvent';\nimport { map } from '../operators/map';\n\n/* tslint:disable:max-line-length */\nexport function fromEventPattern<T>(addHandler: (handler: Function) => any, removeHandler?: (handler: Function, signal?: any) => void): Observable<T>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function fromEventPattern<T>(addHandler: (handler: Function) => any, removeHandler?: (handler: Function, signal?: any) => void, resultSelector?: (...args: any[]) => T): Observable<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Creates an Observable from an arbitrary API for registering event handlers.\n *\n * <span class=\"informal\">When that method for adding event handler was something {@link fromEvent}\n * was not prepared for.</span>\n *\n * ![](fromEventPattern.png)\n *\n * `fromEventPattern` allows you to convert into an Observable any API that supports registering handler functions\n * for events. It is similar to {@link fromEvent}, but far\n * more flexible. In fact, all use cases of {@link fromEvent} could be easily handled by\n * `fromEventPattern` (although in slightly more verbose way).\n *\n * This operator accepts as a first argument an `addHandler` function, which will be injected with\n * handler parameter. That handler is actually an event handler function that you now can pass\n * to API expecting it. `addHandler` will be called whenever Observable\n * returned by the operator is subscribed, so registering handler in API will not\n * necessarily happen when `fromEventPattern` is called.\n *\n * After registration, every time an event that we listen to happens,\n * Observable returned by `fromEventPattern` will emit value that event handler\n * function was called with. Note that if event handler was called with more\n * then one argument, second and following arguments will not appear in the Observable.\n *\n * If API you are using allows to unregister event handlers as well, you can pass to `fromEventPattern`\n * another function - `removeHandler` - as a second parameter. It will be injected\n * with the same handler function as before, which now you can use to unregister\n * it from the API. `removeHandler` will be called when consumer of resulting Observable\n * unsubscribes from it.\n *\n * In some APIs unregistering is actually handled differently. Method registering an event handler\n * returns some kind of token, which is later used to identify which function should\n * be unregistered or it itself has method that unregisters event handler.\n * If that is the case with your API, make sure token returned\n * by registering method is returned by `addHandler`. Then it will be passed\n * as a second argument to `removeHandler`, where you will be able to use it.\n *\n * If you need access to all event handler parameters (not only the first one),\n * or you need to transform them in any way, you can call `fromEventPattern` with optional\n * third parameter - project function which will accept all arguments passed to\n * event handler when it is called. Whatever is returned from project function will appear on\n * resulting stream instead of usual event handlers first argument. This means\n * that default project can be thought of as function that takes its first parameter\n * and ignores the rest.\n *\n * ## Example\n * ### Emits clicks happening on the DOM document\n *\n * ```javascript\n * function addClickHandler(handler) {\n * document.addEventListener('click', handler);\n * }\n *\n * function removeClickHandler(handler) {\n * document.removeEventListener('click', handler);\n * }\n *\n * const clicks = fromEventPattern(\n * addClickHandler,\n * removeClickHandler\n * );\n * clicks.subscribe(x => console.log(x));\n *\n * // Whenever you click anywhere in the browser, DOM MouseEvent\n * // object will be logged.\n * ```\n *\n * ## Example\n * ### Use with API that returns cancellation token\n *\n * ```javascript\n * const token = someAPI.registerEventHandler(function() {});\n * someAPI.unregisterEventHandler(token); // this APIs cancellation method accepts\n * // not handler itself, but special token.\n *\n * const someAPIObservable = fromEventPattern(\n * function(handler) { return someAPI.registerEventHandler(handler); }, // Note that we return the token here...\n * function(handler, token) { someAPI.unregisterEventHandler(token); } // ...to then use it here.\n * );\n * ```\n *\n * ## Example\n * ### Use with project function\n *\n * ```javascript\n * someAPI.registerEventHandler((eventType, eventMessage) => {\n * console.log(eventType, eventMessage); // Logs \"EVENT_TYPE\" \"EVENT_MESSAGE\" to console.\n * });\n *\n * const someAPIObservable = fromEventPattern(\n * handler => someAPI.registerEventHandler(handler),\n * handler => someAPI.unregisterEventHandler(handler)\n * (eventType, eventMessage) => eventType + \" --- \" + eventMessage // without that function only \"EVENT_TYPE\"\n * ); // would be emitted by the Observable\n *\n * someAPIObservable.subscribe(value => console.log(value));\n *\n * // Logs:\n * // \"EVENT_TYPE --- EVENT_MESSAGE\"\n * ```\n *\n * @see {@link fromEvent}\n * @see {@link bindCallback}\n * @see {@link bindNodeCallback}\n *\n * @param {function(handler: Function): any} addHandler A function that takes\n * a `handler` function as argument and attaches it somehow to the actual\n * source of events.\n * @param {function(handler: Function, token?: any): void} [removeHandler] A function that\n * takes a `handler` function as an argument and removes it from the event source. If `addHandler`\n * returns some kind of token, `removeHandler` function will have it as a second parameter.\n * @param {function(...args: any): T} [project] A function to\n * transform results. It takes the arguments from the event handler and\n * should return a single value.\n * @return {Observable<T>} Observable which, when an event happens, emits first parameter\n * passed to registered event handler. Alternatively it emits whatever project function returns\n * at that moment.\n * @static true\n * @name fromEventPattern\n * @owner Observable\n */\n\nexport function fromEventPattern<T>(addHandler: (handler: Function) => any,\n removeHandler?: (handler: Function, signal?: any) => void,\n resultSelector?: (...args: any[]) => T): Observable<T | T[]> {\n\n if (resultSelector) {\n // DEPRECATED PATH\n return fromEventPattern<T>(addHandler, removeHandler).pipe(\n map(args => isArray(args) ? resultSelector(...args) : resultSelector(args))\n );\n }\n\n return new Observable<T | T[]>(subscriber => {\n const handler = (...e: T[]) => subscriber.next(e.length === 1 ? e[0] : e);\n\n let retValue: any;\n try {\n retValue = addHandler(handler);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n\n if (!isFunction(removeHandler)) {\n return undefined;\n }\n\n return () => removeHandler(handler, retValue) ;\n });\n}\n"},"lineCount":null}},"hash":"96e8f414b864e09dcb5f3a8ae131218f","cacheData":{"env":{}}}