import { AsyncIterableX } from './asynciterablex' ; import { throwIfAborted } from '../aborterror' ; export class OfAsyncIterable < TSource > extends AsyncIterableX < TSource > { private _args : TSource [ ] ; constructor ( args ) { super ( ) ; this . _args = args ; } async * [ Symbol . asyncIterator ] ( signal ? ) { throwIfAborted ( signal ) ; for ( const item of this . _args ) { yield item ; } } } template TSource param { ... TSource [ ] } args returns { AsyncIterableX < TSource > } export function of < TSource > ( ... args ) { return new OfAsyncIterable < TSource > ( args ) ; }