tamda
Version:
Practical functional programming library for TypeScript
20 lines (19 loc) • 796 B
TypeScript
import { Mapper } from '../operators';
/**
* Maps over an `array` according to a function `mapFn`, then flattens the result.
* @param array Array to map over.
* @param mapFn Function that extracts an array from each item.
*/
export declare function flatMap<T, R>(array: T[], mapFn: Mapper<T, R[]>): R[];
/**
* Returns a function that
* maps over an `array` according to a function `mapFn`, then flattens the result.
* @param mapFn Function that extracts an array from each item.
*/
export declare function flatMap<T, R>(mapFn: Mapper<T, R[]>): typeof deferred;
/**
* Maps over an `array` according to a previously specified function `mapFn`, then flattens the result.
* @param array Array to map over.
*/
declare function deferred<T, R>(array: T[]): R[];
export {};