1 2 3 4 5 6 7 8 9 10 11 12 | 1 1 292 88 88 18 88 | import {Observable} from '../Observable'; import {ArrayObservable} from '../observable/fromArray'; import {ZipOperator} from './zip-support'; export function zip<T, R>(...observables: Array<Observable<any> | ((...values: Array<any>) => R)>): Observable<R> { const project = <((...ys: Array<any>) => R)> observables[observables.length - 1]; if (typeof project === 'function') { observables.pop(); } return new ArrayObservable(observables).lift(new ZipOperator(project)); } |