UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

20 lines (19 loc) 617 B
/** * Invokes `func` after `wait` milliseconds. Any additional arguments are * provided to `func` when it's invoked. * * @since 5.7.0 * @category Function * @param func The function to delay. * @param wait The number of milliseconds to delay invocation. * @param args The arguments to invoke `func` with. * @returns Returns the timer id. * @example * * ```js * delay(text => console.log(text), 1000, 'later') * // => Logs 'later' after one second. * ``` */ export declare function delay<T extends (...args: any[]) => any>(func: T, wait?: number, ...args: Parameters<T>): number; export default delay;