@erebos/rpc-browser
v0.11.0
Published
RPC for browser
Downloads
7
Keywords
Readme
rpc-browser
rpc-request
or rpc-stream
factory with automatic transport selection.
Installation
yarn add @erebos/rpc-browser
Usage
import browserRPC from '@erebos/rpc-browser'
const rpcOverHTTP = browserRPC('http://localhost') // RequestRPC using HTTP transport
const rpcOverWS = browserRPC('ws://localhost') // StreamRPC using WebSocket transport
API
browserRPC()
Arguments
endpoint: string
: HTTP or WebSocket URL to connect to.
Returns RequestRPC
(with HTTP endpoint) or StreamRPC
(with WebSocket endpoint).
License
MIT