Interface TimeoutSubscriber<T>

Base interface representing a timeout subscriber.

Type Parameters

  • T

Hierarchy

  • TimeoutSubscriber

Properties

Properties

late: ((handler: ((arg: T) => any)) => TimeoutSubscriber<T>)

Type declaration

    • (handler: ((arg: T) => any)): TimeoutSubscriber<T>
    • Handler will execute if the promise resolves after the timeout occurs.

      Parameters

      • handler: ((arg: T) => any)
          • (arg: T): any
          • Parameters

            • arg: T

            Returns any

      Returns TimeoutSubscriber<T>

onTime: ((handler: ((arg: T) => any)) => TimeoutSubscriber<T>)

Type declaration

    • (handler: ((arg: T) => any)): TimeoutSubscriber<T>
    • Handler will execute if the promise resolves before the timeout occurs.

      Parameters

      • handler: ((arg: T) => any)
          • (arg: T): any
          • Parameters

            • arg: T

            Returns any

      Returns TimeoutSubscriber<T>

run: (() => Promise<T>)

Type declaration

    • (): Promise<T>
    • Start the timer.

      Returns Promise<T>

timeout: ((handler: (() => any)) => TimeoutSubscriber<T>)

Type declaration

    • (handler: (() => any)): TimeoutSubscriber<T>
    • Handler will execute if the promise has not resolved when the timeout occurs.

      Parameters

      • handler: (() => any)
          • (): any
          • Returns any

      Returns TimeoutSubscriber<T>