froebel
Version:
TypeScript utility library
19 lines (18 loc) • 869 B
TypeScript
import type { λ } from "./types";
/**
* Given a list of functions that accept the same parameters, returns a function
* that takes these parameters and invokes all of the given functions.
*
* The returned function returns a promise that resolves once all functions
* returned/resolved and rejects if any of the functions throws/rejects - but
* only after all returned promises have been settled.
*/
declare const bundle: <T extends unknown[]>(...funs: (λ<T, any> | undefined)[]) => (...args: T) => Promise<void>;
/**
* Same as {@link bundle}, but return synchronously.
*
* If any of the functions throws an error synchronously, none of the functions
* after it will be invoked and the error will propagate.
*/
export declare const bundleSync: <T extends unknown[]>(...funs: (λ<T, any> | undefined)[]) => (...args: T) => undefined;
export default bundle;