Debian Codegraph @

node/rxjs/src/internal/operators/zip.ts

raw
1 import { zip as zipStatic } from '../observable/zip';
2 import { ObservableInput, ObservableInputTuple, OperatorFunction, Cons } from '../types';
3 import { operate } from '../util/lift';
4
5 /** @deprecated Replaced with {@link zipWith}. Will be removed in v8. */
6 export function zip<T, A extends readonly unknown[]>(otherInputs: [...ObservableInputTuple<A>]): OperatorFunction<T, Cons<T, A>>;
7 /** @deprecated Replaced with {@link zipWith}. Will be removed in v8. */
8 export function zip<T, A extends readonly unknown[], R>(
9 otherInputsAndProject: [...ObservableInputTuple<A>],
10 project: (...values: Cons<T, A>) => R
11 ): OperatorFunction<T, R>;
12 /** @deprecated Replaced with {@link zipWith}. Will be removed in v8. */
13 export function zip<T, A extends readonly unknown[]>(...otherInputs: [...ObservableInputTuple<A>]): OperatorFunction<T, Cons<T, A>>;
14 /** @deprecated Replaced with {@link zipWith}. Will be removed in v8. */
15 export function zip<T, A extends readonly unknown[], R>(
16 ...otherInputsAndProject: [...ObservableInputTuple<A>, (...values: Cons<T, A>) => R]
17 ): OperatorFunction<T, R>;
18
19 /**
20 * @deprecated Replaced with {@link zipWith}. Will be removed in v8.
21 */
22 export function zip<T, R>(...sources: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): OperatorFunction<T, any> {
23 return operate((source, subscriber) => {
24 zipStatic(source as ObservableInput<any>, ...(sources as Array<ObservableInput<any>>)).subscribe(subscriber);
25 });
26 }