UNPKG

1.44 kBTypeScriptView Raw
1import { 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 } from 'rxjs';
15 * import { concatWith, map, take } from 'rxjs/operators';
16 *
17 * const clicks$ = fromEvent(document, 'click');
18 * const moves$ = fromEvent(document, 'mousemove');
19 *
20 * clicks$.pipe(
21 * map(() => 'click'),
22 * take(1),
23 * concatWith(
24 * moves$.pipe(
25 * map(() => 'move')
26 * )
27 * )
28 * )
29 * .subscribe(x => console.log(x));
30 *
31 * // 'click'
32 * // 'move'
33 * // 'move'
34 * // 'move'
35 * // ...
36 * ```
37 *
38 * @param otherSources Other observable sources to subscribe to, in sequence, after the original source is complete.
39 * @return A function that returns an Observable that concatenates
40 * subscriptions to the source and provided Observables subscribing to the next
41 * only once the current subscription completes.
42 */
43export declare function concatWith<T, A extends readonly unknown[]>(...otherSources: [...ObservableInputTuple<A>]): OperatorFunction<T, T | A[number]>;
44//# sourceMappingURL=concatWith.d.ts.map
\No newline at end of file