UNPKG

tsoid

Version:

Typed functional library to deal with async operations.

11 lines (10 loc) 416 B
import { FunctionPromiseA1 } from './types'; import { FunctionA1 } from '../types'; /** * Flats a promise into a value and apply the function fn to the resolved function, * then resolves the result of calling fn applied to the result of p. * * @param {Promise} p * @param {function} fn */ export default function flatMap<A, B>(p: FunctionA1<void, Promise<A>>, fn: FunctionPromiseA1<A, B>): Promise<B | Error>;