UNPKG

tsoid

Version:

Typed functional library to deal with async operations.

8 lines (7 loc) 219 B
/** * Execute the action function if the condition is true. * * @param {boolean} cond * @param {function} fn */ export default function when<A>(cond: boolean, fn: () => Promise<A>): Promise<A | Error | undefined>;