| 1 |
- {"ast":null,"code":"import { isScheduler } from '../util/isScheduler';\nimport { isArray } from '../util/isArray';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { fromArray } from './fromArray';\nconst NONE = {};\nexport function combineLatest(...observables) {\n let resultSelector = null;\n let scheduler = null;\n if (isScheduler(observables[observables.length - 1])) {\n scheduler = observables.pop();\n }\n if (typeof observables[observables.length - 1] === 'function') {\n resultSelector = observables.pop();\n }\n if (observables.length === 1 && isArray(observables[0])) {\n observables = observables[0];\n }\n return fromArray(observables, scheduler).lift(new CombineLatestOperator(resultSelector));\n}\nexport class CombineLatestOperator {\n constructor(resultSelector) {\n this.resultSelector = resultSelector;\n }\n call(subscriber, source) {\n return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));\n }\n}\nexport class CombineLatestSubscriber extends OuterSubscriber {\n constructor(destination, resultSelector) {\n super(destination);\n this.resultSelector = resultSelector;\n this.active = 0;\n this.values = [];\n this.observables = [];\n }\n _next(observable) {\n this.values.push(NONE);\n this.observables.push(observable);\n }\n _complete() {\n const observables = this.observables;\n const len = observables.length;\n if (len === 0) {\n this.destination.complete();\n } else {\n this.active = len;\n this.toRespond = len;\n for (let i = 0; i < len; i++) {\n const observable = observables[i];\n this.add(subscribeToResult(this, observable, observable, i));\n }\n }\n }\n notifyComplete(unused) {\n if ((this.active -= 1) === 0) {\n this.destination.complete();\n }\n }\n notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n const values = this.values;\n const oldVal = values[outerIndex];\n const toRespond = !this.toRespond ? 0 : oldVal === NONE ? --this.toRespond : this.toRespond;\n values[outerIndex] = innerValue;\n if (toRespond === 0) {\n if (this.resultSelector) {\n this._tryResultSelector(values);\n } else {\n this.destination.next(values.slice());\n }\n }\n }\n _tryResultSelector(values) {\n let result;\n try {\n result = this.resultSelector.apply(this, values);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n }\n}","map":{"version":3,"names":["isScheduler","isArray","OuterSubscriber","subscribeToResult","fromArray","NONE","combineLatest","observables","resultSelector","scheduler","length","pop","lift","CombineLatestOperator","constructor","call","subscriber","source","subscribe","CombineLatestSubscriber","destination","active","values","_next","observable","push","_complete","len","complete","toRespond","i","add","notifyComplete","unused","notifyNext","outerValue","innerValue","outerIndex","innerIndex","innerSub","oldVal","_tryResultSelector","next","slice","result","apply","err","error"],"sources":["C:/FatboarProject/angular-client/node_modules/rxjs/_esm2015/internal/observable/combineLatest.js"],"sourcesContent":["import { isScheduler } from '../util/isScheduler';\nimport { isArray } from '../util/isArray';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { fromArray } from './fromArray';\nconst NONE = {};\nexport function combineLatest(...observables) {\n let resultSelector = null;\n let scheduler = null;\n if (isScheduler(observables[observables.length - 1])) {\n scheduler = observables.pop();\n }\n if (typeof observables[observables.length - 1] === 'function') {\n resultSelector = observables.pop();\n }\n if (observables.length === 1 && isArray(observables[0])) {\n observables = observables[0];\n }\n return fromArray(observables, scheduler).lift(new CombineLatestOperator(resultSelector));\n}\nexport class CombineLatestOperator {\n constructor(resultSelector) {\n this.resultSelector = resultSelector;\n }\n call(subscriber, source) {\n return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));\n }\n}\nexport class CombineLatestSubscriber extends OuterSubscriber {\n constructor(destination, resultSelector) {\n super(destination);\n this.resultSelector = resultSelector;\n this.active = 0;\n this.values = [];\n this.observables = [];\n }\n _next(observable) {\n this.values.push(NONE);\n this.observables.push(observable);\n }\n _complete() {\n const observables = this.observables;\n const len = observables.length;\n if (len === 0) {\n this.destination.complete();\n }\n else {\n this.active = len;\n this.toRespond = len;\n for (let i = 0; i < len; i++) {\n const observable = observables[i];\n this.add(subscribeToResult(this, observable, observable, i));\n }\n }\n }\n notifyComplete(unused) {\n if ((this.active -= 1) === 0) {\n this.destination.complete();\n }\n }\n notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n const values = this.values;\n const oldVal = values[outerIndex];\n const toRespond = !this.toRespond\n ? 0\n : oldVal === NONE ? --this.toRespond : this.toRespond;\n values[outerIndex] = innerValue;\n if (toRespond === 0) {\n if (this.resultSelector) {\n this._tryResultSelector(values);\n }\n else {\n this.destination.next(values.slice());\n }\n }\n }\n _tryResultSelector(values) {\n let result;\n try {\n result = this.resultSelector.apply(this, values);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,qBAAqB;AACjD,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,eAAe,QAAQ,oBAAoB;AACpD,SAASC,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,SAAS,QAAQ,aAAa;AACvC,MAAMC,IAAI,GAAG,CAAC,CAAC;AACf,OAAO,SAASC,aAAaA,CAAC,GAAGC,WAAW,EAAE;EAC1C,IAAIC,cAAc,GAAG,IAAI;EACzB,IAAIC,SAAS,GAAG,IAAI;EACpB,IAAIT,WAAW,CAACO,WAAW,CAACA,WAAW,CAACG,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE;IAClDD,SAAS,GAAGF,WAAW,CAACI,GAAG,CAAC,CAAC;EACjC;EACA,IAAI,OAAOJ,WAAW,CAACA,WAAW,CAACG,MAAM,GAAG,CAAC,CAAC,KAAK,UAAU,EAAE;IAC3DF,cAAc,GAAGD,WAAW,CAACI,GAAG,CAAC,CAAC;EACtC;EACA,IAAIJ,WAAW,CAACG,MAAM,KAAK,CAAC,IAAIT,OAAO,CAACM,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE;IACrDA,WAAW,GAAGA,WAAW,CAAC,CAAC,CAAC;EAChC;EACA,OAAOH,SAAS,CAACG,WAAW,EAAEE,SAAS,CAAC,CAACG,IAAI,CAAC,IAAIC,qBAAqB,CAACL,cAAc,CAAC,CAAC;AAC5F;AACA,OAAO,MAAMK,qBAAqB,CAAC;EAC/BC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