Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Hook<T>

Type parameters

  • T

Hierarchy

  • Hook

Index

Constructors

constructor

  • new Hook(name: string): Hook

Properties

allowConcurrentNotifications

allowConcurrentNotifications: boolean = false

name

name: string

Protected notificationSemaphore

notificationSemaphore: Semaphore = new Semaphore( 1 )

Protected subscriptions

subscriptions: HookSubscription<T>[] = []

Methods

[Symbol.asyncIterator]

  • [Symbol.asyncIterator](): AsyncIterator<T, any, undefined>

isSubscribed

  • isSubscribed(): boolean

notify

  • notify(arg?: T): Promise<void>

setParallel

  • setParallel(): this

setSequential

  • setSequential(): this

subscribe

toAsyncStream

  • toAsyncStream(errorHook?: Hook<unknown>, endHook?: Hook<unknown>): AsyncStream<T>

toPromise

  • toPromise(errorHook?: Hook<unknown>): Promise<T>

unsubscribe

Generated using TypeDoc