UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

19 lines (18 loc) 571 B
/** * Defers invoking the `func` until the current call stack has cleared. Any * additional arguments are provided to `func` when it's invoked. * * @since 5.7.0 * @category Function * @param func The function to defer. * @param args The arguments to invoke `func` with. * @returns Returns the timer id. * @example * * ```js * defer(text => console.log(text), 'deferred') * // => Logs 'deferred' after one millisecond. * ``` */ export declare function defer<F extends (...args: any[]) => any>(func: F, ...args: Parameters<F>): number; export default defer;