PATH:
usr
/
local
/
lib
/
node_modules
/
ghost-cli
/
node_modules
/
rxjs
/
_esm2015
/
internal
/
observable
import { isScheduler } from '../util/isScheduler'; import { isArray } from '../util/isArray'; import { OuterSubscriber } from '../OuterSubscriber'; import { subscribeToResult } from '../util/subscribeToResult'; import { fromArray } from './fromArray'; const NONE = {}; export function combineLatest(...observables) { let resultSelector = null; let scheduler = null; if (isScheduler(observables[observables.length - 1])) { scheduler = observables.pop(); } if (typeof observables[observables.length - 1] === 'function') { resultSelector = observables.pop(); } if (observables.length === 1 && isArray(observables[0])) { observables = observables[0]; } return fromArray(observables, scheduler).lift(new CombineLatestOperator(resultSelector)); } export class CombineLatestOperator { constructor(resultSelector) { this.resultSelector = resultSelector; } call(subscriber, source) { return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector)); } } export class CombineLatestSubscriber extends OuterSubscriber { constructor(destination, resultSelector) { super(destination); this.resultSelector = resultSelector; this.active = 0; this.values = []; this.observables = []; } _next(observable) { this.values.push(NONE); this.observables.push(observable); } _complete() { const observables = this.observables; const len = observables.length; if (len === 0) { this.destination.complete(); } else { this.active = len; this.toRespond = len; for (let i = 0; i < len; i++) { const observable = observables[i]; this.add(subscribeToResult(this, observable, observable, i)); } } } notifyComplete(unused) { if ((this.active -= 1) === 0) { this.destination.complete(); } } notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { const values = this.values; const oldVal = values[outerIndex]; const toRespond = !this.toRespond ? 0 : oldVal === NONE ? --this.toRespond : this.toRespond; values[outerIndex] = innerValue; if (toRespond === 0) { if (this.resultSelector) { this._tryResultSelector(values); } else { this.destination.next(values.slice()); } } } _tryResultSelector(values) { let result; try { result = this.resultSelector.apply(this, values); } catch (err) { this.destination.error(err); return; } this.destination.next(result); } } //# sourceMappingURL=combineLatest.js.map
[-] zip.js.map
[edit]
[-] concat.js
[edit]
[-] fromEventPattern.js
[edit]
[-] combineLatest.js
[edit]
[-] using.js
[edit]
[-] fromArray.js.map
[edit]
[-] generate.js
[edit]
[-] generate.js.map
[edit]
[+]
dom
[+]
..
[-] defer.js
[edit]
[-] ConnectableObservable.js
[edit]
[-] concat.js.map
[edit]
[-] from.js.map
[edit]
[-] range.js.map
[edit]
[-] merge.js.map
[edit]
[-] bindCallback.js
[edit]
[-] forkJoin.js.map
[edit]
[-] bindNodeCallback.js.map
[edit]
[-] SubscribeOnObservable.js
[edit]
[-] interval.js
[edit]
[-] fromPromise.js.map
[edit]
[-] of.js
[edit]
[-] ConnectableObservable.js.map
[edit]
[-] throwError.js.map
[edit]
[-] iif.js
[edit]
[-] timer.js.map
[edit]
[-] merge.js
[edit]
[-] bindCallback.js.map
[edit]
[-] onErrorResumeNext.js
[edit]
[-] onErrorResumeNext.js.map
[edit]
[-] partition.js
[edit]
[-] never.js.map
[edit]
[-] fromPromise.js
[edit]
[-] pairs.js
[edit]
[-] timer.js
[edit]
[-] interval.js.map
[edit]
[-] zip.js
[edit]
[-] iif.js.map
[edit]
[-] fromArray.js
[edit]
[-] race.js
[edit]
[-] range.js
[edit]
[-] race.js.map
[edit]
[-] forkJoin.js
[edit]
[-] bindNodeCallback.js
[edit]
[-] throwError.js
[edit]
[-] fromEvent.js
[edit]
[-] empty.js.map
[edit]
[-] defer.js.map
[edit]
[-] SubscribeOnObservable.js.map
[edit]
[-] empty.js
[edit]
[-] pairs.js.map
[edit]
[-] fromIterable.js.map
[edit]
[-] never.js
[edit]
[-] fromEventPattern.js.map
[edit]
[-] combineLatest.js.map
[edit]
[-] partition.js.map
[edit]
[-] using.js.map
[edit]
[-] fromEvent.js.map
[edit]
[-] of.js.map
[edit]
[-] from.js
[edit]
[-] fromIterable.js
[edit]