Skip to Content
GraphQL Tools
DocumentationAPI@graphql-tools/utilssrcfunctionsmapAsyncIterator

Function: mapAsyncIterator()

mapAsyncIterator<T, U>(iterator, onNext, onError?, onEnd?): AsyncIterableIterator<U>

Defined in: node_modules/@whatwg-node/promise-helpers/typings/index.d.ts:29

Given an AsyncIterable and a callback function, return an AsyncIterator which produces values mapped via calling the callback function.

Type Parameters

T

T

U

U

Parameters

iterator

AsyncIterable<T, any, any> | AsyncIterator<T, any, any>

onNext

(value) => MaybePromise<U>

onError?

any

onEnd?

() => MaybePromise<void>

Returns

AsyncIterableIterator<U>