NewDash

    Function defer

    • Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to func when it's invoked.

      Type Parameters

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

      Parameters

      • func: F

        The function to defer.

      • ...args: Parameters<F>

        The arguments to invoke func with.

      Returns number

      Returns the timer id.

      5.7.0

      defer(text => console.log(text), 'deferred')
      // => Logs 'deferred' after one millisecond.
    MMNEPVFCICPMFPCPTTAAATR