Debian Codegraph @

node/rxjs/src/internal/operators/concat.ts

raw
1 import { ObservableInputTuple, OperatorFunction, SchedulerLike } from '../types';
2 import { operate } from '../util/lift';
3 import { concatAll } from './concatAll';
4 import { popScheduler } from '../util/args';
5 import { from } from '../observable/from';
6
7 /** @deprecated Replaced with {@link concatWith}. Will be removed in v8. */
8 export function concat<T, A extends readonly unknown[]>(...sources: [...ObservableInputTuple<A>]): OperatorFunction<T, T | A[number]>;
9 /** @deprecated Replaced with {@link concatWith}. Will be removed in v8. */
10 export function concat<T, A extends readonly unknown[]>(
11 ...sourcesAndScheduler: [...ObservableInputTuple<A>, SchedulerLike]
12 ): OperatorFunction<T, T | A[number]>;
13
14 /**
15 * @deprecated Replaced with {@link concatWith}. Will be removed in v8.
16 */
17 export function concat<T, R>(...args: any[]): OperatorFunction<T, R> {
18 const scheduler = popScheduler(args);
19 return operate((source, subscriber) => {
20 concatAll()(from([source, ...args], scheduler)).subscribe(subscriber);
21 });
22 }