UNPKG

1.4 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, 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 */
42export declare function concatWith<T, A extends readonly unknown[]>(...otherSources: [...ObservableInputTuple<A>]): OperatorFunction<T, T | A[number]>;
43//# sourceMappingURL=concatWith.d.ts.map
\No newline at end of file