- reduceAsync<T, I>(arr, callbackFn, initValue): Promise<I>
参数
- arr: ArrayLike<T>
- callbackFn: ((initValue: I, value: T, index: number, array: ArrayLike<T>) => Promise<I>)
- (initValue, value, index, array): Promise<I>
参数
- initValue: I
- value: T
- index: number
- array: ArrayLike<T>
返回 Promise<I>
- initValue: I
返回 Promise<I>
- reduceAsync<T>(arr, callbackFn): Promise<Awaited<ReturnType<T>>>
类型参数
- T extends ((...args: any[]) => Promise<any>)
参数
- arr: ArrayLike<T>
- callbackFn: ((initValue: Awaited<ReturnType<T>>, item: T, index: number, array: ArrayLike<T>) => Promise<Awaited<ReturnType<T>>>)
- (initValue, item, index, array): Promise<Awaited<ReturnType<T>>>
参数
- initValue: Awaited<ReturnType<T>>
- item: T
- index: number
- array: ArrayLike<T>
返回 Promise<Awaited<ReturnType<T>>>
返回 Promise<Awaited<ReturnType<T>>>
- reduceAsync<T>(arr, callbackFn): Promise<ReturnType<T>>
类型参数
- T extends ((...args: any[]) => any)
参数
- arr: ArrayLike<T>
- callbackFn: ((initValue: ReturnType<T>, item: T, index: number, array: ArrayLike<T>) => ReturnType<T>)
- (initValue, item, index, array): ReturnType<T>
参数
- initValue: ReturnType<T>
- item: T
- index: number
- array: ArrayLike<T>
返回 ReturnType<T>
返回 Promise<ReturnType<T>>
reduce异步回调版
reduce promise 跟 promiseQueue差不多,此函数多了callbackFn