async-call-rpc

A lightweight JSON RPC client & server

Home > async-call-rpc > EventBasedChannel

EventBasedChannel interface

This interface represents a “on message” - “send response” model.

Signature:

export interface EventBasedChannel<Data = unknown> 

Remarks

Usually used for there is only 1 remote (act like a client). Example: Example for EventBasedChannel

Methods

Method Description
on(listener) Register the message listener.
send(data) Send the data to the remote side.