Options
All
  • Public
  • Public/Protected
  • All
Menu

Module lib/utils/async

Index

Functions

Functions

each

  • each<T>(collection: Collection<T>, fn: (arg: T, key: string) => unknown): Promise<Collection<T>>
  • Iterates over each element of the collection and calls the specified function against them

    export

    Type parameters

    • T

    Parameters

    • collection: Collection<T>
    • fn: (arg: T, key: string) => unknown
        • (arg: T, key: string): unknown
        • Parameters

          • arg: T
          • key: string

          Returns unknown

    Returns Promise<Collection<T>>

isPromise

  • isPromise(obj: any): obj is Promise<any>
  • Returns true if the specified object is a promise

    export

    Parameters

    • obj: any

    Returns obj is Promise<any>

timer

  • timer(fn: (...args: any[]) => unknown): Promise<number>
  • Runs a function and returns the time it took in ms to execute it

    export

    Parameters

    • fn: (...args: any[]) => unknown
        • (...args: any[]): unknown
        • Parameters

          • Rest ...args: any[]

          Returns unknown

    Returns Promise<number>

Generated using TypeDoc