Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BroadcastChannel

Hierarchy

Index

Properties

EventTarget

EventTarget: { constructor: any; prototype: EventTarget }

Type declaration

Readonly name

name: string

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

onmessage

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

onmessageerror

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

Methods

addEventListener

close

  • close(): void
  • Closes the BroadcastChannel object, opening it up to garbage collection.

    Returns void

dispatchEvent

  • dispatchEvent(event: Event): boolean
  • 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.

    Parameters

    Returns boolean

postMessage

  • postMessage(message: any): void
  • Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays.

    Parameters

    • message: any

    Returns void

removeEventListener

Generated using TypeDoc