import { AsyncIterableX } from '../asynciterablex' ; import { OperatorAsyncFunction } from '../../interfaces' ; import { wrapWithAbort } from './withabort' ; import { throwIfAborted } from '../../aborterror' ; export class ConcatAllAsyncIterable < TSource > extends AsyncIterableX < TSource > { private _source : AsyncIterable < AsyncIterable < TSource > > ; constructor ( source ) { super ( ) ; this . _source = source ; } async * [ Symbol . asyncIterator ] ( signal ? ) { throwIfAborted ( signal ) ; for await ( const outer of wrapWithAbort ( this . _source , signal ) ) { for await ( const item of wrapWithAbort ( outer , signal ) ) { yield item ; } } } } template T returns { OperatorAsyncFunction < AsyncIterable < T > , T > } export function concatAll < T > ( ) { return function concatAllOperatorFunction ( source ) : AsyncIterableX < T > { return new ConcatAllAsyncIterable < T > ( source ) ; } ; }