async-ray
Version:
Allow perform every, filter, find, findIndex, forEach, map, reduce, reduceRight and some on array using Async callback
14 lines (13 loc) • 378 B
TypeScript
/** returns any type values */
export declare type CallBackMap<T, R> = (value: T, index?: number, collection?: T[]) => Promise<R>;
/**
* Async Map function
*
* @export
* @template T
* @template R
* @param {T[]} elements
* @param {CallBackMap<T, R>} cb
* @returns {Promise<R[]>}
*/
export declare function aMap<T, R>(elements: T[], cb: CallBackMap<T, R>): Promise<R[]>;