NewDash

    Function delay

    • Invokes func after wait milliseconds. Any additional arguments are provided to func when it's invoked.

      Type Parameters

      • T extends (...args: any[]) => any

      Parameters

      • func: T

        The function to delay.

      • wait: number = 0

        The number of milliseconds to delay invocation.

      • ...args: Parameters<T>

        The arguments to invoke func with.

      Returns number

      Returns the timer id.

      5.7.0

      delay(text => console.log(text), 1000, 'later')
      // => Logs 'later' after one second.
    MMNEPVFCICPMFPCPTTAAATR