post-me

Home > post-me > LocalHandle

LocalHandle interface

A handle to the local end of the connection

Signature:

export interface LocalHandle<M extends MethodsType = any, E extends EventsType = any> 

Remarks

Use this handle to:

Methods

Method Description
emit(eventName, data, options) Emit a custom event with a payload. The event can be captured by the other context.
setEmitTransfer(eventName, transfer) Specify which parts of the payload of a given event should be transferred into the other context instead of cloned.
setMethod(methodName, method) Set a specific method that will be exposed to the other end of the connection.
setMethods(methods) Set the methods that will be exposed to the other end of the connection.
setReturnTransfer(methodName, transfer) Specify which parts of the return value of a given method call should be transferred into the other context instead of cloned.