UNPKG

just-defer-call

Version:

The `deferCall` utility is a higher-order function that defers the execution of a given function until the returned function is called. It supports synchronous and asynchronous functions.

4 lines (2 loc) 157 B
declare const deferCall: <T, Args extends unknown[]>(fn: (...args: Args) => T | Promise<T>, ...args: Args) => (() => T | Promise<T>); export { deferCall };