UNPKG

tsoid

Version:

Typed functional library to deal with async operations.

15 lines (14 loc) 585 B
import { FunctionPromiseA1 } from './types'; import { FunctionA1 } from '../types'; /** * Bind is a transient function that takes an initial promise and resolves it, * the value of the promise will be passed as argument to the first action, * then the resolved result of the first action will be passed as argument * to the second action and so on. * * The value of the last action will be returned. * * @param {Promise} p * @param {function[]} fns */ export default function bind<A>(p: FunctionA1<void, Promise<A>>, ...fns: FunctionPromiseA1<any, any>[]): Promise<unknown>;