• Wraps the callback for setInterval so errors get caught and logged. Parameters are identical to the setInterval parameters starting from the 3rd argument. The logger and message will be used when the callback throws an error. Supports asynchronous callback functions.

    Type Parameters

    • TArgs

    Parameters

    • logger: Logger
    • message: string
    • callback: ((...cbArgs: TArgs[]) => void | Promise<void>)
        • (...cbArgs): void | Promise<void>
        • Parameters

          Returns void | Promise<void>

    • Optionalms: number
    • Rest...args: TArgs[]

    Returns NodeJS.Timeout