744860a1bacd383d244e5483eec735313d82416981bb8d7a456472e9a2db481f09b0189a2c65e0de1e9c1c97ade1786a7110ab2976fe7db3eb38664bf739fb 1.1 KB

1234567891011121314151617181920212223242526272829
  1. import { OperatorFunction, ObservableInputTuple } from '../types';
  2. /**
  3. * Creates an Observable that mirrors the first source Observable to emit a next,
  4. * error or complete notification from the combination of the Observable to which
  5. * the operator is applied and supplied Observables.
  6. *
  7. * ## Example
  8. *
  9. * ```ts
  10. * import { interval, map, raceWith } from 'rxjs';
  11. *
  12. * const obs1 = interval(7000).pipe(map(() => 'slow one'));
  13. * const obs2 = interval(3000).pipe(map(() => 'fast one'));
  14. * const obs3 = interval(5000).pipe(map(() => 'medium one'));
  15. *
  16. * obs1
  17. * .pipe(raceWith(obs2, obs3))
  18. * .subscribe(winner => console.log(winner));
  19. *
  20. * // Outputs
  21. * // a series of 'fast one'
  22. * ```
  23. *
  24. * @param otherSources Sources used to race for which Observable emits first.
  25. * @return A function that returns an Observable that mirrors the output of the
  26. * first Observable to emit an item.
  27. */
  28. export declare function raceWith<T, A extends readonly unknown[]>(...otherSources: [...ObservableInputTuple<A>]): OperatorFunction<T, T | A[number]>;
  29. //# sourceMappingURL=raceWith.d.ts.map