- reduce<T>(array, reducer): Generator<MaybePromise<T>, Awaited<T>, Awaited<T>>
Parameters
reducer: ((previousValue, currentValue, currentIndex, array) => MaybePromise<T>)
- (previousValue, currentValue, currentIndex, array): MaybePromise<T>
Parameters
previousValue: T
currentValue: T
currentIndex: number
array: T[]
Returns Generator<MaybePromise<T>, Awaited<T>, Awaited<T>>
- reduce<T, U>(array, reducer, initialValue): Generator<MaybePromise<U>, Awaited<U>, Awaited<U>>
Parameters
reducer: ((previousValue, currentValue, currentIndex, array) => MaybePromise<U>)
- (previousValue, currentValue, currentIndex, array): MaybePromise<U>
Parameters
previousValue: U
currentValue: T
currentIndex: number
array: T[]
Returns Generator<MaybePromise<U>, Awaited<U>, Awaited<U>>
yield*
instruction formaybeAsync
to reduce a MaybePromise of array using a maybe-async reducer.