Class Blocker<T>

Provides mechanism for blocking async processes and unblocking them from an external context.

Type Parameters

  • T = void

    The value that can be passed to unblock to resolve the block promise.

Constructors

Accessors

Methods

Constructors

Accessors

  • get isBlocked(): boolean
  • true if Blocker is blocked and wasn't unblocked yet, or false otherwise.

    Returns boolean

Methods

  • Returns promises that is fulfilled with the result passed to unblock. If blocker is already blocked then the same promise is returned.

    Returns Promise<T>

  • Fulfills the promise returned from block. If the blocker isn't blocked then no-op.

    Parameters

    • value: T

    Returns void