@reactivex/ix-esnext-esm
Version:
The Interactive Extensions for JavaScript
1 lines • 1.03 kB
Source Map (JSON)
{"version":3,"sources":["asynciterable/operators/racewith.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CACtB,GAAG,OAAiC;IAEpC,OAAO,SAAS,wBAAwB,CAAC,MAA8B;QACrE,OAAO,IAAI,iBAAiB,CAAU,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC;AACJ,CAAC","file":"racewith.js","sourcesContent":["import { MonoTypeOperatorAsyncFunction } from '../../interfaces';\nimport { RaceAsyncIterable } from '../race';\n\n/**\n * Propagates the async sequence that reacts first.\n *\n * @export\n * @param {...AsyncIterable<T>[]} sources The source sequences.\n * @return {MonoTypeOperatorAsyncFunction<TSource> } An async sequence that surfaces either of the given sequences, whichever reacted first.\n */\nexport function raceWith<TSource>(\n ...sources: AsyncIterable<TSource>[]\n): MonoTypeOperatorAsyncFunction<TSource> {\n return function raceWithOperatorFunction(source: AsyncIterable<TSource>) {\n return new RaceAsyncIterable<TSource>([source, ...sources]);\n };\n}\n"]}