An extended BroadcastChannel that uses a second BroadcastChannel to post messages, such that this instance can receive messages sent by itself.

Hierarchy

  • BroadcastChannel
    • DualBroadcastChannel

Constructors

Properties

name: string

Returns the channel name (as passed to the constructor).

MDN Reference

onmessage: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: BroadcastChannel
      • ev: MessageEvent<any>

      Returns any

onmessageerror: null | ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Parameters

      • this: BroadcastChannel
      • ev: MessageEvent<any>

      Returns any

publisher: BroadcastChannel

Methods

  • Type Parameters

    • K extends keyof BroadcastChannelEventMap

    Parameters

    • type: K
    • listener: ((this, ev) => any)
        • (this, ev): any
        • Parameters

          • this: BroadcastChannel
          • ev: BroadcastChannelEventMap[K]

          Returns any

    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

    MDN Reference

    Parameters

    • event: Event

    Returns boolean

  • Type Parameters

    • K extends keyof BroadcastChannelEventMap

    Parameters

    • type: K
    • listener: ((this, ev) => any)
        • (this, ev): any
        • Parameters

          • this: BroadcastChannel
          • ev: BroadcastChannelEventMap[K]

          Returns any

    • Optional options: boolean | EventListenerOptions

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | EventListenerOptions

    Returns void

Generated using TypeDoc