Options
All
  • Public
  • Public/Protected
  • All
Menu

Module defer

Index

References

Functions Function

References

Renames and re-exports defer

Function Functions

  • defer<F>(func: F, ...args: Parameters<F>): number
  • Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to func when it's invoked.

    since

    5.7.0

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

    Type Parameters

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

    Parameters

    • func: F

      The function to defer.

    • Rest ...args: Parameters<F>

      The arguments to invoke func with.

    Returns number

    Returns the timer id.