0b4101042937baaad0c2428329823bcf7908226896bde0a4c9aaa60e5e2dcbf12d577744876bfd9a31f8aecccf928efe150699623c8b751e47bb2be1b06e60 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { ObservableInputTuple, OperatorFunction } from '../types';
  2. /**
  3. * Emits all of the values from the source observable, then, once it completes, subscribes
  4. * to each observable source provided, one at a time, emitting all of their values, and not subscribing
  5. * to the next one until it completes.
  6. *
  7. * `concat(a$, b$, c$)` is the same as `a$.pipe(concatWith(b$, c$))`.
  8. *
  9. * ## Example
  10. *
  11. * Listen for one mouse click, then listen for all mouse moves.
  12. *
  13. * ```ts
  14. * import { fromEvent, map, take, concatWith } from 'rxjs';
  15. *
  16. * const clicks$ = fromEvent(document, 'click');
  17. * const moves$ = fromEvent(document, 'mousemove');
  18. *
  19. * clicks$.pipe(
  20. * map(() => 'click'),
  21. * take(1),
  22. * concatWith(
  23. * moves$.pipe(
  24. * map(() => 'move')
  25. * )
  26. * )
  27. * )
  28. * .subscribe(x => console.log(x));
  29. *
  30. * // 'click'
  31. * // 'move'
  32. * // 'move'
  33. * // 'move'
  34. * // ...
  35. * ```
  36. *
  37. * @param otherSources Other observable sources to subscribe to, in sequence, after the original source is complete.
  38. * @return A function that returns an Observable that concatenates
  39. * subscriptions to the source and provided Observables subscribing to the next
  40. * only once the current subscription completes.
  41. */
  42. export declare function concatWith<T, A extends readonly unknown[]>(...otherSources: [...ObservableInputTuple<A>]): OperatorFunction<T, T | A[number]>;
  43. //# sourceMappingURL=concatWith.d.ts.map