Options
All
  • Public
  • Public/Protected
  • All
Menu

Module delay

Index

References

Functions Function

References

Renames and re-exports delay

Function Functions

  • delay<T>(func: T, wait?: number, ...args: Parameters<T>): number
  • Invokes func after wait milliseconds. Any additional arguments are provided to func when it's invoked.

    since

    5.7.0

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

    Type parameters

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

    Parameters

    • func: T

      The function to delay.

    • wait: number = 0

      The number of milliseconds to delay invocation.

    • Rest ...args: Parameters<T>

      The arguments to invoke func with.

    Returns number

    Returns the timer id.