Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • HubClass

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

name

name: string

protectedChannels

protectedChannels: string[] = ['core','auth','api','analytics','interactions','pubsub','storage','ui','xr',]

Methods

dispatch

  • dispatch(channel: string, payload: HubPayload, source?: string, ampSymbol?: Symbol): void
  • Used to send a Hub event.

    Parameters

    • channel: string

      The channel on which the event will be broadcast

    • payload: HubPayload

      The HubPayload

    • Default value source: string = ""

      The source of the event; defaults to ''

    • Optional ampSymbol: Symbol

      Symbol used to determine if the event is dispatched internally on a protected channel

    Returns void

listen

  • Used to listen for Hub events.

    Parameters

    • channel: string | RegExp

      The channel on which to listen

    • Optional callback: HubCallback | LegacyCallback

      The callback to execute when an event is received on the specified channel

    • Default value listenerName: string = "noname"

      The name of the listener; defaults to 'noname'

    Returns (Anonymous function)

    A function which can be called to cancel the listener.

remove

  • remove(channel: string | RegExp, listener: HubCallback): void