aebc111fc9aa009e6b76f9b0be9a75959a5ae04255733ee629031fa51ac1a5e3a026013e7364c5ac96f0c423abfc1670b8128e4165f0dc0cc128d1aa6a9660 1.4 KB

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