Skip to main content

Class: AsyncIteratorAdapter<T, R>

@divine/commons.AsyncIteratorAdapter

Type parameters

NameType
TT
Rvoid

Implements

  • AsyncIterable<T>

Constructors

constructor

new AsyncIteratorAdapter<T, R>(_close?)

Type parameters

NameType
TT
Rvoid

Parameters

NameType
_close?() => Promise<void>

Defined in

commons/src/async-iterable.ts:31

Methods

[asyncIterator]

[asyncIterator](): AsyncGenerator<T, R, unknown>

Returns

AsyncGenerator<T, R, unknown>

Implementation of

AsyncIterable.[asyncIterator]

Defined in

commons/src/async-iterable.ts:54


next

next(event): AsyncIteratorAdapter<T, R>

Parameters

NameType
eventT

Returns

AsyncIteratorAdapter<T, R>

Defined in

commons/src/async-iterable.ts:39


onClose

onClose(close): AsyncIteratorAdapter<T, R>

Parameters

NameType
close() => Promise<void>

Returns

AsyncIteratorAdapter<T, R>

Defined in

commons/src/async-iterable.ts:34


return

return(result): AsyncIteratorAdapter<T, R>

Parameters

NameType
resultR

Returns

AsyncIteratorAdapter<T, R>

Defined in

commons/src/async-iterable.ts:49


throw

throw(error): AsyncIteratorAdapter<T, R>

Parameters

NameType
errorError

Returns

AsyncIteratorAdapter<T, R>

Defined in

commons/src/async-iterable.ts:44