Debian Codegraph @

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

raw
1 import { ObservableInputTuple, OperatorFunction } from '../types';
2 import { argsOrArgArray } from '../util/argsOrArgArray';
3 import { raceWith } from './raceWith';
4
5 /** @deprecated Replaced with {@link raceWith}. Will be removed in v8. */
6 export function race<T, A extends readonly unknown[]>(otherSources: [...ObservableInputTuple<A>]): OperatorFunction<T, T | A[number]>;
7 /** @deprecated Replaced with {@link raceWith}. Will be removed in v8. */
8 export function race<T, A extends readonly unknown[]>(...otherSources: [...ObservableInputTuple<A>]): OperatorFunction<T, T | A[number]>;
9
10 /**
11 * Returns an Observable that mirrors the first source Observable to emit a next,
12 * error or complete notification from the combination of this Observable and supplied Observables.
13 * @param args Sources used to race for which Observable emits first.
14 * @return A function that returns an Observable that mirrors the output of the
15 * first Observable to emit an item.
16 * @deprecated Replaced with {@link raceWith}. Will be removed in v8.
17 */
18 export function race<T>(...args: any[]): OperatorFunction<T, unknown> {
19 return raceWith(...argsOrArgArray(args));
20 }