Class: AsyncIteratorAdapter<T, R>
@divine/commons.AsyncIteratorAdapter
Type parameters
Name | Type |
---|---|
T | T |
R | void |
Implements
AsyncIterable
<T
>
Constructors
constructor
• new AsyncIteratorAdapter<T
, R
>(_close?
)
Type parameters
Name | Type |
---|---|
T | T |
R | void |
Parameters
Name | Type |
---|---|
_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
Name | Type |
---|---|
event | T |
Returns
AsyncIteratorAdapter
<T
, R
>
Defined in
commons/src/async-iterable.ts:39
onClose
▸ onClose(close
): AsyncIteratorAdapter
<T
, R
>
Parameters
Name | Type |
---|---|
close | () => Promise <void > |
Returns
AsyncIteratorAdapter
<T
, R
>
Defined in
commons/src/async-iterable.ts:34
return
▸ return(result
): AsyncIteratorAdapter
<T
, R
>
Parameters
Name | Type |
---|---|
result | R |
Returns
AsyncIteratorAdapter
<T
, R
>
Defined in
commons/src/async-iterable.ts:49
throw
▸ throw(error
): AsyncIteratorAdapter
<T
, R
>
Parameters
Name | Type |
---|---|
error | Error |
Returns
AsyncIteratorAdapter
<T
, R
>