post-me

Home > post-me > Messenger

Messenger interface

An interface used internally to exchange low level messages across contexts.

Signature:

export interface Messenger 

Remarks

Having a single interface lets post-me deal with Workers, Windows, and MessagePorts without having to worry about their differences.

A few concrete implementations of the Messenger interface are provided.

Methods

Method Description
addMessageListener(listener) Add a listener to messages received by the other context
postMessage(message, transfer) Send a message to the other context