UNPKG

1.85 kBSource Map (JSON)View Raw
1{"version":3,"sources":["asynciterable/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,kBAA4B,SAAQ,cAAuB;IAG/D,YAAY,MAA8B;QACxC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,CAAC,MAAM,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;IAC9C,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,KAAK,CACnB,MAA8B,EAC9B,QAAoE;IAEpE,OAAO,IAAI,kBAAkB,CAAU,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AAC3D,CAAC","file":"chain.js","sourcesContent":["import { AsyncIterableX } from './asynciterablex';\n\nclass ChainAsyncIterable<TResult> extends AsyncIterableX<TResult> {\n private _result: AsyncIterable<TResult>;\n\n constructor(result: AsyncIterable<TResult>) {\n super();\n this._result = result;\n }\n\n [Symbol.asyncIterator]() {\n return this._result[Symbol.asyncIterator]();\n }\n}\n\n/**\n * Returns an async iterable sequence that is the result of invoking the selector on the source sequence,\n * without sharing subscriptions. This operator allows for a fluent style of writing queries that use\n * the same sequence multiple times.\n * @param {AsyncIterable<TSource>} source Source sequence that will be shared in the selector function.\n * @param {function(source: AsyncIterable<TSource>): AsyncIterable<TResult>} selector Selector function which can use\n * the source sequence as many times as needed, without sharing subscriptions to the source sequence.\n * @returns An async iterable sequence that contains the elements of a sequence produced by multicasting the source\n * sequence within a selector function.\n */\nexport function chain<TSource, TResult>(\n source: AsyncIterable<TSource>,\n selector: (source: AsyncIterable<TSource>) => AsyncIterable<TResult>\n): AsyncIterableX<TResult> {\n return new ChainAsyncIterable<TResult>(selector(source));\n}\n"]}
\No newline at end of file