• Defers invoking the function until the current call stack has cleared

    Example

    const test = (msg) => console.log(msg);
    defer(test, 'a'), test('b'); // logs 'b' then 'a'

    Type Parameters

    • Args extends unknown[]

    • F extends ((...a: Args) => unknown)

    Parameters

    • func: F
    • Rest ...args: Args

    Returns NodeJS.Timeout

Generated using TypeDoc