Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Signal<THandler>

Type parameters

  • THandler: (...args: any[]) => any

Hierarchy

  • Signal

Index

Constructors

constructor

  • new Signal<THandler>(): Signal<THandler>
  • Type parameters

    • THandler: (...args: any[]) => any

    Returns Signal<THandler>

Properties

Private connectionsCount

connectionsCount: any

Private emitDepth

emitDepth: any

Private hasNewLinks

hasNewLinks: any

Private Readonly head

head: any

Private unsetNewLink

unsetNewLink: any

Methods

connect

  • Subscribe to this signal.

    Parameters

    • callback: THandler

      This callback will be run when emit() is called.

    • Optional order: number

      Handlers with a higher order value will be called later.

    Returns SignalConnection

disconnect

  • disconnect(callback: THandler): boolean
  • Unsubscribe from this signal with the original callback instance. While you can use this method, the SignalConnection returned by connect() will not be updated!

    Parameters

    • callback: THandler

      The callback you passed to connect().

    Returns boolean

disconnectAll

  • disconnectAll(): void
  • Disconnect all handlers from this signal event.

    Returns void

emit

  • emit(...args: Parameters<THandler>): void
  • Publish this signal event (call all handlers).

    Parameters

    • Rest ...args: Parameters<THandler>

    Returns void

Protected emitCollecting

  • emitCollecting(collector: Collector<THandler>, args: Parameters<THandler>): void
  • Parameters

    • collector: Collector<THandler>
    • args: Parameters<THandler>

    Returns void

getConnectionsCount

  • getConnectionsCount(): number
  • Returns number

    The number of connections on this signal.

hasConnections

  • hasConnections(): boolean
  • Returns boolean

    true if this signal has connections.

Generated using TypeDoc